community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Date Time Format

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???

Alteryx Certified Partner
Alteryx Certified Partner

Hi @ZoeM 

 

Yes, use the DateTimeFormat function

 

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

 

This should work.

 

Cheers,

Asteroid

So...

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

Alteryx Certified Partner
Alteryx Certified Partner

@ZoeM 

 

Is your date field in Date Format?


Cheers,

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,

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? 

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,

 

Asteroid

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

 

My field is:

 

Defaults.JPGDefaults.JPG

Alteryx Certified Partner
Alteryx Certified Partner

@ZoeM 

 

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


Example - Start_Date_Formatted

 

Cheers,

Labels