I'm trying to convert a time (including timezone) to just a time with everything in UTC. When i have the timezone GMT it works fine, but soon as i use PDT or PST i get an error. Am i going about this the right way or is there a better way to do this?
>>> datetime.datetime.strptime("10:54:02 PM GMT", "%I:%M:%S %p %Z").strftime('%H:%M:%S')
'22:54:02'
I've seen pytz might be helpful to me but not sure how to use it within the date string. Any help is appreciated.