0

I imported a CSV from NWS to a file geodatabase and would like to calculate a new field (Time1).

I used the following code. It succeeds with no errors. However, I want to remove the colons. I am not sure why they carry over to the new field? Both time and Time1 are string fields.

Left( [time_],2  ) + Mid( [time_], 3,4 ) + " CST"

enter image description here

1

I was able to use the replace function on the Time1 field in field calculator. Selected Python not VB.

!Time1!.replace(":","") 
1

Try this:

!time_!.split(":")[0]+" "+!time_!.split(":")[1]+" CST"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.