Alteryx Designer Desktop Discussions

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

Date time Parse

JAIN2
Meteoroide

Dear All,

Can you please advise how to parse a string field like this 10-Jul-20 09.29.32.521000000 AM. I need a standard date time format to allow performing a Date time difference between two dates. 

 

Many thanks for your help in advance. 

 

Regards

6 RESPOSTAS 6

Hi @JAIN2 , try using datetimeparse function it will convert your date format into standard format that alteryx use.

 

Formula:

DateTimeParse(Substring([Field1],0,18)+" "+Right([Field1], 2),"%d-%b-%y %I.%M.%S %p")

 

grazitti_sapna_0-1594376781089.png

 

 

I hope it helps.

Thanks.

 

Sapna Gupta
JosephSerpis
17 - Castor
17 - Castor

Hi @JAIN2 I mocked up a workflow let me know what you think?Dates_10072020.JPG

wwatson
Quasar

wwatson_0-1594378497801.png

 

OllieClarke
15 - Aurora
15 - Aurora

@JosephSerpis great answer, although this doesn't round the seconds based on the milliseconds. @JAIN2 if you care about that, then you can amend Joseph's formula to:

datetimeparse(left([Date],16)+tostring(tonumber(substring([Date],16,5)),0)+" "+RIGHT([Date],2),"%d-%b-%y %I.%M.%S %p")

 

JAIN2
Meteoroide

Thank you, It was a perfect solution.

JAIN2
Meteoroide

Thank you joseph..

Rótulos