community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

How do i parse this date to datetime?

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

Alteryx Certified Partner

Hey @zsharif 

 

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

Nebula
Nebula

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

 

  

Alteryx Certified Partner

@danilang 

 

Totally didn't read the second part of that post

Nebula
Nebula

@LordNeilLord 

 

Happens to all of us

 

Cheers

 

Dan

Labels