Alteryx Designer Desktop Discussions

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

Date formating/ conversion from a String value

hima_shar
8 - Asteroid

Hi All,

 

I am receiving inputs in a file like '2017/12/27 4:12:37 PM' . I want to convert this to a date timestamp (24Hrs format) 2017-12-27 16:12:37.

Another example is

Input. -    2017/12/27 3:12:37 AM

Output. -   2017-12-27 3:12:37

 

Can someone pls suggest how to achieve this?

 

Regards

Himanshu

2 REPLIES 2
BenMoss
ACE Emeritus
ACE Emeritus

Hi @hima_shar,

 

The best tool for you in this instance is 'Date Time Parse' tool.

 

Within this tool you select the field you wish to convert from a string and specify the different date parts that exist within it. 

 

Alteryx will then build a date time column from this.

 

In your instance the following calculation should work:

 

%Y/%M/%d %I:%m:%S %p

 

I've attached a sample workflow using your two examples.

 

Ben

hima_shar
8 - Asteroid
Thank you Ben for providing quick and perfect solution.
Labels