Alteryx Designer Desktop Discussions

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

How do i parse this date to datetime?

zsharif
7 - Meteor

I have a column with time in the format: 17 Jul 2019 11:15:16, it's in string format how do i parse to datetime? I have tried to specifiy the format using the parse function but it doesn't seem to be working.  e..g i would like in format 17:07:2019 11:15:16

4 REPLIES 4
LordNeilLord
15 - Aurora

Hey @zsharif 

 

It's DateTimeParse([Field1],"%d %b %Y %H:%M:%S")

danilang
19 - Altair
19 - Altair

Hi @zsharif 

 

A good solution from @LordNeilLord.  His formula will convert your input to the format that Alteryx uses internally  "2019-07-17 11:15:16".  If you need to do any date time manipulations, adding intervals, comparing dates, extracting the year, etc, this is the format that the date will need to be in.

 

If you want your field in the format 17:07:2019 11:15:16,  then you have to add another step.  

 

datetimeformat([Field1],"%d:%m:%Y %H:%M:%S")  

 

This will create a string field that you can use for output or display 

 

Dan

 

  

LordNeilLord
15 - Aurora

@danilang 

 

Totally didn't read the second part of that post

danilang
19 - Altair
19 - Altair

@LordNeilLord 

 

Happens to all of us

 

Cheers

 

Dan

Labels