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

Alteryx Designer Desktop Discussions

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

String to DateTime conversion

dkma
8 - Asteroid

How to convert the String " 13-Dec-2020 05:35 PM" to yyyy-mm-dd hh:mm:ss

 

 

I tried formula:

DateTimeParse("13-Dec-2020 05:35 PM", "%d-%b-%Y %H:%M %p"),

 

 

 But it is giving an error message

5 REPLIES 5
Emil_Kos
17 - Castor
17 - Castor

Hi @dkma,

 

DateTimeParse("13-Dec-2020 05:35 PM", "%d-%b-%Y %I:%M %p")

 

I believe you need to change H to I and it will start working.

Please mark my post as a solution if this was helpful. 

atcodedog05
22 - Nova
22 - Nova

Hi @dkma 

 

You need to use below formula

 

DateTimeParse("13-Dec-2020 05:35 PM", "%d-%b-%Y %I:%M %p")

 

H replaced by I 

 

atcodedog05_0-1608029996011.png

 

You can check the below link for the format reference

https://help.alteryx.com/current/designer/datetime-functions

atcodedog05_1-1608030133156.png

 

atcodedog05_0-1608030100581.png

 

Hope this helps 🙂

Emil_Kos
17 - Castor
17 - Castor

Hi @atcodedog05,

 

I am so proud I was faster then you with a parse question. That is something new! 😄

grazitti_sapna
17 - Castor

Hi @dkma , another way of solving this.

 

Formula- dd-Mon-yyyy %I:%M %p

 

grazitti_sapna_0-1608030461162.png

 

I hope this helps.

 

Thanks.

 

Sapna Gupta
Qiu
21 - Polaris
21 - Polaris

@grazitti_sapna 
I did not know we can do something like this.
Thank you.😁

Labels
Top Solution Authors