ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

Date time Parse

JAIN2
メテオロイド

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件の返信6
grazitti_sapna
キャスター

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
クエーサー

wwatson_0-1594378497801.png

 

OllieClarke
16 - Nebula
16 - Nebula

@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
メテオロイド

Thank you, It was a perfect solution.

JAIN2
メテオロイド

Thank you joseph..

ラベル
トップのソリューション投稿者