Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

DateTime Format

RMcB
6 - Meteoroid

Hello!

 

I'm new to Alteryx and have a column named "RS_RECORDED_DATETIME" that is currently in the format yyyy-mm-dd mm:ss. I need to convert it to mm/dd/yyyy hh24:mi:ss.

 

Should I create a formula for this or use datetime parse? 

 

Thank you!

7 REPLIES 7
fmvizcaino
17 - Castor
17 - Castor

Hi @RMcB ,

 

You can use the DateTime tool to do operations like that.

fmvizcaino_0-1593561682538.png

Be aware that your column will now be type string. Dates in Alteryx has the yyyy-mm-dd format

 

Best,

Fernando Vizcaino

 

RMcB
6 - Meteoroid

Thank you, Fernando! I have to add 24 after the hours (MM/DD/YYYY HH24:MI:SS). Any idea how to do this?

fmvizcaino
17 - Castor
17 - Castor

Hi @RMcB ,

 

I'm not sure if I understood you right. Do you want to add the number 24 in between your hours, right?

If yes, I'm attaching an example here.

Best,

Fernando Vizcaino

echuong1
Alteryx Alumni (Retired)

I believe the approach outlined above should work for your purposes.

 

I do want to note that by formatting the data in this manner, you are converting the data to a STRING rather than a DATETIME value. As a result, you won't be able to use the new value for datetime functions (datetimeadd, datetimediff, etc.). If you do need to perform calculations with these values, you'll need to use the original field. 

 

echuong1_0-1593568872526.png

 

RMcB
6 - Meteoroid

Thank you!!

RMcB
6 - Meteoroid

Thank you!!  

RMcB
6 - Meteoroid

This worked, but now I need to remove the leading 0 for hours 1-9 (circled below). Is this possible?

 

RMcB_0-1593581372717.png

 

Labels