Free Trial

Alteryx Designer Desktop Discussions

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

Date formatting (Converting Mon dd yyyy to dd/mm/yyyy)

khadijahneddy
6 - Meteoroid

Hi, I am trying to convert Jun 30 2021 which is defined as String to  30/6/2021 (dd/mm/yyyy) and in Date format . Does anyone know how to solve this?

 

khadijahneddy_0-1629970686397.png

 

3 REPLIES 3
AngelosPachis
16 - Nebula

Hi @khadijahneddy ,

 

Here are two ways you can do it, either by using a single formula tool or two Datetime tools

 

AngelosPachis_0-1629971195950.png

 

 

Hope that helps,

Angelos

RolandSchubert
16 - Nebula
16 - Nebula

Hi @khadijahneddy ,

 

you can convert the date  to a date data type using DateTimeParse([Tx_DT], '%b %d %Y') and convert this to the required format using DateTimeFormat([Dt_DT], '%d/%m/%Y'). The first formula will result in a date data type, the second one will return a string.

 

Both in one go is also possible:

 

  DateTimeFormat(DateTimeParse([Tx_DT], '%b %d %Y') , '%d/%m/%Y')

 

Let me know if it works for you.

Best,

 

Roland

danilang
19 - Altair
19 - Altair

Hi @khadijahneddy 

 

In Alteryx, all field defined as DATE format must use YYYY-MM-DD format.  Any other format will be a string field. So you can't have both "30/6/2021 (dd/mm/yyyy) and in Date format".  The standard way to deal with this is to use the Alteryx date format within the workflow and convert the fields to string and change the date values to the format you need.

 

Dan

 

  

Labels
Top Solution Authors