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

Convert Text "date/time am pm" to date/time am pm format

kcho
5 - Atom

Hi, 

 

I have a text file have "date/time am pm" and want to convert into date/time format. 

 

The text data is m/dd/yyyy h:mm:ss am/pm as below

1/12/2019 7:46:04 PM

 

I used  "DateTime" workflow with "String to Date/Time format" 

--> It returned as 1/12/2019 7:46:04 .This is 7 am not 7 pm. 

 

Can you please help with this?

4 REPLIES 4
fmvizcaino
17 - Castor
17 - Castor

Hi @kcho ,

 

You can use the datetimeparse function as example attached. The specifiers to use in the functions are shown here. https://help.alteryx.com/2020.1/Reference/Functions.htm

 

DateTimeParse([Field1],'%m/%d/%y %I:%M:%S %p')

 

Best,

Fernando Vizcaino

kcho
5 - Atom

Thank you very much! 🙂

DataMeister
7 - Meteor

Fernando:

Thanks for your solution to this common problem, but the challenge is really for Alteryx's developers to rise to the occasion! Come on, AltDevs; it's a date/time with am pm format--every human being knows what it means. Even children know. Users are too busy solving to be bothered with the kindergarten of data which includes date & time handling, adding or eliminating leading zeros in all sorts of numbers, and converting between number & string. These are absurdities we shouldn't have to deal with anymore in our daily work. Once these are all automated the way they need to be, we'll play a game of "thank the dev!"

davidhardister
8 - Asteroid

removed

Labels
Top Solution Authors