Free Trial

Alteryx Designer Desktop Discussions

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

Regex my date format

RogerA
8 - Asteroid

I have been looking at a few regex examples but struggling to get them to work to my particular data.  My date data looks like

 

Jan 5 2017 12:00AM

Jan 20 2017 10:07PM

Jan 21 2017 12:00AM

Jan 1 2017 8:02AM

Feb 4 2018 3:15PM

 

I need to convert this to a date, also converting the time to 24 hour format.  Any idea?

 

Thanks

Roger

4 REPLIES 4
BenMoss
ACE Emeritus
ACE Emeritus

Should be relatively straight forward.

 

Use the 'Date time parse' tool and type in a custom expression at the bottom which would be

 

%b %d %Y %I:%M%p

 

Example attached.

 

Ben

RogerA
8 - Asteroid

Thanks Ben that's worked perfectly.  Can you explain the logic in the query?  I can figure out the % but what is th "b" and how does it convert AM PM to 24hr?

BenMoss
ACE Emeritus
ACE Emeritus

No problem at all!

 

%b (short month) %d (days) %Y (full year) %I(12 hour hour):%M (minutes)%p(AM or PM)

There is an excellent description of all the various options that you can select here: https://help.alteryx.com/11.7/Reference/DateTimeFunctions.htm

Ben :) 

RogerA
8 - Asteroid

Thank you Ben - will be reading that

Labels
Top Solution Authors