Start Free Trial

Alteryx Designer Desktop Discussions

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

String to Date

Sarath27
8 - Asteroid

Hi All,

 

Please find the attachment, I am trying to convert the string to Date. i.e 2023_06_01 should be converted as 2023-06-01.

 

Thanks in Advance.

Sarath.

 

 

3 REPLIES 3
Luke_C
17 - Castor
17 - Castor

Hi @Sarath27 

 

You could use this formula:

DateTimeParse([Field1],'%Y_%m_%d')

 

 

image.png

Adriankp
8 - Asteroid

Hi Sarath,

 

You can do this with the DateTimeParse function, but you need to adjust the format to fit your string.

 

DateTimeParse([Date],"%Y_%m_%d")

 

%Y = Four digit year

Underscore as separator

%m = One or two digit month

Underscore as separator

%d = One or two digit day

 

Hope it helps!

JamesCharnley
13 - Pulsar

Hi @Sarath27 

 

When you're parsing dates you need to match the string format exactly, like so:

 

image.png

 

with the formula

 

DateTimeParse([MyDate],'%Y_%m_%d')
Labels
Top Solution Authors