Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

Date Time Format

Highlighted
8 - Asteroid

Hello Community!

So i am running around in circles for something I should know.

I have a date Field, 2019-05-22 and I want to convert it to a string like this: 22-May-2019

 

This should be simple right???

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

Hi @ZoeM 

 

Yes, use the DateTimeFormat function

 

DateTimeFormat([date], "%d-%b-%Y")

 

This should work.

 

Cheers,

8 - Asteroid

So...

I have tried it but I am getting Blanks in my output. I have tried String and V String formats...

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@ZoeM 

 

Is your date field in Date Format?


Cheers,

Highlighted
8 - Asteroid

Thansk for the quick reply

Yes the field is in date format. Then I am changing the date format to the desired as you've suggested, then I want it to be a string. 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@ZoeM 

 

exampledate.PNG

 

The "Field1" is in date Format.

 

Then I create a new field with V_WString format and use the function I mentioned.

 

Cheers,

Highlighted
8 - Asteroid

Great example, I think because my date field is formatted as 05/22/2019 and not 2019-05-22. So I probably have to change it to the ISO standard first? 

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@ZoeM 

 

Yes, in this case you could use this formula:

 

DateTimeFormat(DateTimeParse([date], "%m/%d/%Y"), "%d-%b-%Y")

 

First you use DateTimeParse function, to change it to a Date Format

Then you use DateTimeFormat function, to bring it to a string format again.

 

Cheers,

 

Highlighted
8 - Asteroid

oddly enough I was convinced that would work but it didnt. 😞

 

My field is:

 

Defaults.JPGDefaults.JPG

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

@ZoeM 

 

you need to create a new field.in the Formula Tool


Example - Start_Date_Formatted

 

Cheers,

Labels