community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

Datetime format to Excel number format

Meteoroid

I want to convert Alteryx "datetime" format to MS-Excel "number" format

Example:

Alteryx: " 2019-07-21 12:30:00 " 

MS-Excel: " 43667.52 "

 

Kindly help me out in getting the result.

 

Alteryx Certified Partner
Alteryx Certified Partner

Hi @amogha_cj 

 

 

This should work:

 

Conversion DateTime.PNG

 

First the difference in days from Jan,01,1900 (that's how we get the Excel Number)

Then, the time difference in seconds so you can get the decimals.

 

DateTimeDiff([Field1],"1900-01-01 00:00:00", "days") +
(DateTimeDiff([Field1],DateTimeTrim([Field1],"day"),"seconds")/(60*60*24)) + 2

 

Cheers,

Meteoroid

Hi @Thableaus ,

 

Thanks alot!

Labels