Alteryx Designer Desktop Discussions

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

Date conversion

srk0609
8 - Asteroid

I want to convert the submit date 06/22/2022 11:42 in the csv file to 22-JUN-22 in string format. Can anyone please help?

 

I want to convert the date 06/22/2022 11:42 in the csv file to 22-JUN-22 in string format. Can anyone please help?

5 REPLIES 5
IraWatt
17 - Castor
17 - Castor

Hey @srk0609,

The most understandable way to do this is with two datetime tools:

IraWatt_0-1656367972187.png

The first creates a date type column "DateTime_Out" the second converts that date to your format as a string.

Any questions or issues please ask :)
HTH!
Ira

IraWatt
17 - Castor
17 - Castor

@srk0609 Or you can use one formula tool with using the date time functions:

 

DateTimeFormat(DateTimeParse([Field1],"%m/%d/%Y"),"%d-%h-%y")

 

 

IraWatt_0-1656368310879.png

 

 

 

DataNath
17 - Castor

One option:

Uppercase(DateTimeFormat(DateTimeParse([Input],'%m/%d/%Y %H:%M'),'%d-%b-%y'))

 

DataNath_0-1656368302333.png

 

Luke_C
17 - Castor

Hi @srk0609 

 

@IraWatt 's solution is definitely the understandable way to do it if you're new to date functions. Here's a way to do it in a formula tool. This also allows you to get the month in uppercase like your example:

 

Uppercase(DateTimeFormat(DateTimeParse([Field1],'%m/%d/%Y'),'%d-%b-%Y'))

 

This page has all the info you'll need on date time functions: DateTime Functions | Alteryx Help

 

Luke_C_0-1656368319537.png

 

srk0609
8 - Asteroid

Thank you, Ira

Labels