I have a time field looks like: 1322Z
I need it to look like 13:22:00Z.
How do I insert colons and add zeros to represent the seconds?
After goofing with python and arcade for way too long, I'm asking for a lifeline
Solved! Go to Solution.
Hi Richard,
It appears that you are referring to a 'text' field. The below snippet may work for you assuming they are all the same length of characters. You will need to change 'test' to your attribute name.
Concatenate([left($feature.test, 2), mid($feature.test, 2, 2), "00Z"],":")
since you tagged python as well.
Python parser, into a text field, replace 'fld' with the !YourFldName! with the surrounding !
fld = "1322Z"
"{}:{}:00Z".format(fld[:2], fld[2:4])
'13:22:00Z'
I think you want text(value, format);
https://developers.arcgis.com/arcade/function-reference/text_functions/
Hi Richard,
It appears that you are referring to a 'text' field. The below snippet may work for you assuming they are all the same length of characters. You will need to change 'test' to your attribute name.
Concatenate([left($feature.test, 2), mid($feature.test, 2, 2), "00Z"],":")
since you tagged python as well.
Python parser, into a text field, replace 'fld' with the !YourFldName! with the surrounding !
fld = "1322Z"
"{}:{}:00Z".format(fld[:2], fld[2:4])
'13:22:00Z'
Brilliant! Thank you.