We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Date format

KeerthanaPriya
6 - Meteoroid

Hello,

 

Can anyone help me with a tool to convert the standard date format (yyyy-mm-dd) to the specified format (mm/dd/yyyy)

 

Thanks.

6 REPLIES 6
Carlithian
11 - Bolide
11 - Bolide

Ahoy, 

 

You can do this in a Formula Tool, you are trying to change the format of a date into a string, so you need the 

DateTimeFormat function, this takes two parameters, the field you are changing, this must have the data type of Date and the format you want to change it to , what you need is this
DateTimeFormat([Existing Date], '%m/%d/%Y')

FOr a full breakdown of the DateTime Function you can check the help documents here https://help.alteryx.com/current/en/designer/functions/datetime-functions.html#:~:text=Alteryx%20use....


Happy Alteryxing
leonhekkert
8 - Asteroid

To add to this, if you want to overwrite the same field with the new format you will need to change the datatype (as it is probably date or datetime now)

This cannot be done with a formula tool, because when you transform a field with this tool, it cannot change datatype at the same time. 

 

The transformation and change of data type can be done in one multi-field tool.

Use the expression as @Carlithian gave and change the data type to a string format.

aatalai
15 - Aurora

@KeerthanaPriya agreed with @Carlithian but this could also be done via the datetimetool

 

aatalai_0-1752145957594.png

 

Carlithian
11 - Bolide
11 - Bolide

It can indeed be done in that tool, but I hate it and will never recommend it 😂


Happy Alteryxing
aatalai
15 - Aurora

@Carlithian completely agree and I would always do it the formula tool way, but always good to show other methods (preaching to the choir here)

KeerthanaPriya
6 - Meteoroid

Thank you, folks :) I could get the desired format now.

Labels
Top Solution Authors