I am trying to convert a string field that is actually a date to a specific format:
example: string reads 050619 and I need to convert it to 05/06/2019.
Thanks in advance for the help.
Solved! Go to Solution.
Hello,
You need the DateTime tool. https://help.alteryx.com/2018.3/DateTime.htm?Highlight=date%20time
String to Date/Time format: Converts string data to a DateTime format in the yyyy-MM-dd format or yyyy-MM-dd hh:mm:ss format.
EDIT:
Please see the attached example :)
You can use the DateTime tool to parse the string to date from a custom format. In your example it is MMddyy.
Hi @jderienzo
Here's the expression to parse that string into the standard Alteryx format, then output in the format you specified:
DateTimeFormat(DateTimeParse([String],"%m%d%y"),"%m/%d/%Y")
In this case, i place your input value, "050619" into a field called [String].
Drew:
Thank you for the detailed answer and sample, work perfectly.
Kind Regards,
Jason D.
User | Count |
---|---|
19 | |
14 | |
13 | |
9 | |
8 |