Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Issue With DateTimeParse

michaeljones1
6 - 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

5 REPLIES 5
Thableaus
17 - Castor
17 - Castor

Hi @michaeljones1 

 

Change %X to %p

 

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

 

Cheers,

JosephSerpis
17 - Castor
17 - Castor

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

LordNeilLord
15 - Aurora

Hey @michaeljones1 

 

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

 

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

michaeljones1
6 - Meteoroid

Thanks everyone!!

Dazzerman
11 - Bolide

Try this formula :

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

Labels
Top Solution Authors