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.

Date format 30th Nov 2022 Issue

DanielCarro
8 - Asteroid

Hi,

 

I have a string data as 30th Nov 2022 and trying to converting it into date format but the result are coming out as Null.

I tried DateTimeParse and result is null as well tried the DateTime tool but not sure how to enter the customisation for this date.

 

Much appreciated any advice.

 

Kind Regards,

Dan

4 REPLIES 4
Felipe_Ribeir0
16 - Nebula

Hi @DanielCarro 

 

You can use this formula

datetimeparse([Date], '%dth %b %Y')

Felipe_Ribeir0_0-1670845273799.png

 

binuacs
21 - Polaris

@DanielCarro One way of doing this

binuacs_0-1670845393916.png

 

 

DanielCarro
8 - Asteroid

Hi Felipe, it worked well, thank you very much

Christina_H
14 - Magnetar

This only works for dates using "th" as the suffix, so e.g. it'll work for 30th Nov but not 1st Dec.  I would update the formula to remove all possible suffixes before converting to a date:

 

datetimeparse(REGEX_Replace([Date], "st|nd|rd|th", ""), '%d %b %Y')

 

(The replace function also removes "st" from the end of August, but %b will still convert it correctly)

Labels
Top Solution Authors