Hi,
I would like to the covert a string into the desired time format below:
String: 165208
Desired format: 16:52:08
How would I go about doing this?
Thanks!
Courtney
Solved! Go to Solution.
Hi @poles1c,
If you are using version 11, you can use the date/time tool and use the 'custom' format. The custom config would be:
hhmmss
That is pretty easy (given that your input is a STRING).
For a regular expression, I would do something like:
regex_replace([Field1],"(\d\d)(\d\d)(\d\d)",'$1:$2:$3')
if the incoming data doesn't have 6 characters (e.g. 95822), both will have issues. If you don't have leading zeros, you will need to :
PadLeft([Field1],"0",6)
before your time conversion.
Does this help to solve your challenge?
Cheers,
Mark
Thanks!
Hi, I am a newbie in Alteryx, I have converted the string to 6 digits, but not able to convert it into date formate using Regex, the number is in this way: 093500.
Thanks
Sorry but I got the solution, I was doing it using date-time parse, but this time I tried using the formula tool. and this worked.
Thanks a lot, this was helpful
please share the formula you have used. thank you.