Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

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

Convert a date from M/D/Y or D/M/Y format to number

AlvAlRuGon
6 - Meteoroid

Hi everyone

 

I want to thank you all for all for contributing to this community. I have found a lot of solutions to issues looking at this forum.

 

I'm currently facing some issue trying to convert a date to number (see the sample attached to this message). Basically I need to convert a date in Month/Day/Year formal, to number (00000)

 

For example, today is 2/25/2020, and translated to number would be 43886.

 

Let me know if additional information is required.

 

Thank you all.

 

Alan

 

 

2 REPLIES 2
T_Willins
14 - Magnetar
14 - Magnetar

Hi @AlvAlRuGon,

 

This number is the number of days since 01/01/1900, which can be found using a DateTimeDiff formula:  DateTimeDiff([DateTime_Out],ToDate("1900-01-01"),"days")+2  where DateTime_Out is the column with the date in question.  See attached workflow for an example (DateTime tool only needed for formatting).

 

 

AlvAlRuGon
6 - Meteoroid

I'm surprised of two things: how fast the response time is, and how easy it was. I tried lots of stuff before your solution.

 

Thanks a lot

Labels