Get time format value from Excel Coulmn

excel
activities

#1

Hi I am trying to get time from excel column, once i had declared DateTime type variable it showing error

"Date and Time Converter Can not Convert from System.Double"
When I tried in double type variable output came as below, I tried converting double to date again, could not work, Please HELP

DoubleTypeOutPut

Excel Column Format

image


#2

hi @hkjobs1988,

Could you attach your excel file and workflow?
So we can help you easier.

Best Regards,
Hoang Anh.


#3

@anhth15 Thank you for response , attaching the same , kindly change the path in excel scope

S8509186.zip (10.2 KB)


#4

Hi @hkjobs1988,

please refer my workflow in the attachment.

Best Regards,test_01.xaml (13.7 KB)

Hoang Anh.


#5

Hey @hkjobs1988

You can try @anhth15 way. it is good by using Set Format activity :slight_smile: :+1:

Just wanna add one more way for just your knowledge :slight_smile:

You can use DateTime.FromOADate(yourdoublevalue) as well here :slight_smile:

DateTime datetime_dt = DateTime.FromOADate(yourdoublevalue)
string time= String.Format("{0:HH:mm:ss}",datetime_dt )

Sample for your Reference : One_more_way.xaml (12.3 KB)

Regards…!!
Aksh


#6

Thank you @anhth15 and @aksh1yadav both method tested


#7

You are welcome :slight_smile: