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

Issue With DateTimeParse

Meteoroid

Hi all,

 

I know I'm not the only one with this issue but could definitely use an assist. Trying to work through a DateTimeParse and it seems to keep erring out.

 

The original string is as follows: 2019/07/08 7:33:18 PM

 

Would've thought that this formula would do the charm but I'm getting the error below: DateTimeParse([Created On],"%Y/%m/%d %I:%M:%S %X")

 

Formula (12) DATETIMEPARSE: Cannot convert "2019/04/01 9:07:50 PM" to a date/time with format "%Y/%m/%d %I:%M:%S %X": Expected a number for hour: 'PM'

 

Thanks!

Michael

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @michaeljones1 

 

Change %X to %p

 

DateTimeParse([Created On],"%Y/%m/%d %I:%M:%S %p")

 

Cheers,

Alteryx Certified Partner

Hi @michaeljones1 this syntax should work DateTimeParse([Created On],"%Y/%m/%d %I:%M:%S %p")

Alteryx Certified Partner

Hey @michaeljones1 

 

When you use %X you don't need to specify the H:M:S

 

DateTimeParse([Field1], "%Y/%m/%d %X")

Meteoroid

Thanks everyone!!

Asteroid

Try this formula :

DateTimeParse([Date_string],"%Y/%m/%d %X")

Labels