Alteryx Designer Desktop Discussions

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

Date Format Issue

Jshelp11
5 - Atom

Hi All,

 

I have data coming in for a date in the format of Jul 22 2024 12:00AM and need the end result to be 07-22-2024. The incoming data type is a VWString and I need the final version to be in a Date format type. I have tried some of the other solutions posted and tried flipping back and forth with the date time tool but I keep getting an end result in date format data type of YYYY-MM-DD instead of MM-DD-YYYY. 

5 REPLIES 5
binuacs
20 - Arcturus

@Jshelp11 One way of doing this with the DteTimeFunction

image.png

Jshelp11
5 - Atom

Hi @binuacs

 

The problem with this is that output is still in a string format. When you try and convert that string format to a date with the datetime tool it flips the date format back to YYYY-MM-DD

binuacs
20 - Arcturus

@Jshelp11 Alteryx support only the ISO format (YYYY-MM-DD) as the Date data type, rest of the all formats should be in String DataType

cjaneczko
13 - Pulsar

@Jshelp11 wrote:

Hi @binuacs

 

The problem with this is that output is still in a string format. When you try and convert that string format to a date with the datetime tool it flips the date format back to YYYY-MM-DD


Review the Date Time Functions page. YYYY-MM-DD is the only "Date" format. As mentioned above all other formats are considered strings.

 

https://help.alteryx.com/current/en/designer/functions/datetime-functions.html#idm45439287072816

 

CoG
13 - Pulsar

For the purpose of being able to run Date Time Functions, it is critical that only a single format be used to handle this data type. So as your workflow is run, you want to take all dates from inputs and convert them to the standard ISO 8601 format (yyyy-mm-dd) to make use of this helpful functionality. That being said, not everyone likes seeing dates in that format, and so best practice would be to wait until the end of your workflow and then convert those dates back into formatted strings that match the desired look of the date time. This way your workflow runs well and the output looks good!

 

Happy Solving! 

Labels