I have records coming in from multiple combined files. In one field, some of the dates have leading zeroes where month/day <10, but others do not:
example:
13.04.2023
9.8.2022
5.7.2022
28.02.2022
How can I standardise these to all be dd-mm-yyyy with leading zeros where applicable and covert to date format?
example desired output:
13.04.2023
09.08.2022
05.07.2022
28.02.2022
Solved! Go to Solution.
Hey @RBF, there's a couple of methods for parsing incoming dates into a standard format. My personal preference is a Formula tool with the DateTimeParse() function, where we tell Alteryx the format of the incoming string and it converts it into an ISO date format (YYYY-MM-DD, which is the only form Alteryx can work with as an actual Date data type). Here's how I'd do that for your case, where the following specifiers are used:
%d - 1 or 2 digit day
%m - months as numbers 1-12
%Y - year
More info on those and more here: https://help.alteryx.com/20231/designer/datetime-functions
On the latter part of your request i.e. using dd.mm.yyyy as an output with Date data type, this isn't possible for the reason mentioned above. You'd have to have this as a String which we could do like so:
Workflow attached - hope this helps
You should be able to use the DateTime tool with a custom option.
dd.MM.yyyy
Worked great thanks