I am trying to parse a 6 digit date using the DateTimeParse formula. The date string looks like 180401 for April 01, 2018. The formula that I have entered below is returning a date of 1804-09-01. I am not able to get the function to recognize that the year is a 2 digits.
DateTimeParse(180401,"%y%m%d)
Any ideas on how to resolve this issue? Any insight would be greatly appreciated.
Solved! Go to Solution.
DateTimeParse(Trim(REGEX_Replace(tostring([DateField]), "(\d{2})", '$1-'),"-"),"%y-%m-%d")
I am just now reviewing this using alteryx and see the issue.
BTW, just posted this KB article: https://community.alteryx.com/t5/Alteryx-Knowledge-Base/Marquee-Crew-s-Guide-to-Dates/ta-p/156024
I don't like it, but this works.
Cheers,
Mark