I currently have data with the date field formatted as "September 15, 2019" as an example.
Is there a tool that can automatically transform this into a date format that follows dd-mm-yyyy?
Many thanks
afk
Hi @akasubi,
You can use the DateTime tool found under the Parse section of tools and enter the following date format:
Month dd, yyyy
This will convert that date into a date type field.
Hope this helps!
Thanks,
Josh
There are two steps that are necessary here:
1. Parse the input value into the standard date format (ISO 8601) which is YYYY-MM-DD. This is the only official date format that Alteryx supports for datetime calculations (all other formats are simply string fields).
This can be achieved with the following expression:
DateTimeParse([Input],"%B %d,%Y")
2. Take this date field and output as a string in the DD-MM-YYYY format you requested:
DateTimeFormat([DateField],"%d-%m-%Y")
You can combine both of these steps into one expression to achieve your desired result in one formula:
DateTimeFormat(DateTimeParse([Input],"%B %d,%Y"),"%d-%m-%Y")
DATETIMEPARSE([FIELD], '%b %d, %Y)
Thanks for this @CharlieS
Can you explain what the syntax '%B %d,%' means? i just want to understand how the formula works.
Thanks for this @JoshuaGostick
Would just like to add for others who may have the same query, you first select 'Custom' in the list of incoming string fields, and then in the box under it, you specify the format Month dd, yyyy (or whatever it is in your case)