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

Converting Text With Date Time Zone to Date

MAAbdullahAlMubarah
8 - Asteroid

Dear Experts 

 

I need someone to guide me on how to convert Text contains time zone like this "Mon, 25 Oct 1999 16:06:00 -0700 (PDT)" Into Date "25-10-1999", Please note that I tried the available date conversion and convertx but I failed to change it into Date.

 

Thank you 

7 REPLIES 7
jdunkerley79
ACE Emeritus
ACE Emeritus
DateTimeFormat(
DateTimeParse(
trim(left([Input],16)),
"%a, %d %b %Y"),
"%d-%m-%Y")

This should do what you want.

 

- First get first 16 letters 

- Parse to Alteryx date

- Format to string

MAAbdullahAlMubarah
8 - Asteroid

It gives me a NULL Value

MAAbdullahAlMubarah
8 - Asteroid

Please check the file

MAAbdullahAlMubarah
8 - Asteroid

If you convert the Output into String some of them will be NULL and the other will work correctly.

jdunkerley79
ACE Emeritus
ACE Emeritus

I'd miscounted and you need 17 not 16.

 

If you want a Date output then:

DateTimeParse(
trim(left([Detail],17)),
"%a, %d %b %Y")

Will work

MAAbdullahAlMubarah
8 - Asteroid

@jdunkerley79 It works now but there is one problem when I convert the string into date through (select tool) it will gives NULL , how we overcome this issue? 

jdunkerley79
ACE Emeritus
ACE Emeritus

For Date you must use the later formula without the datetimeformat part.

 

Alteryx dates are just strings in yyyy-MM-dd format.

Labels
Top Solution Authors