The following code
from datetime import datetime
dt = '2019-07-21T08:54:32.115285+00:00'
datetime.strptime(dt, '%Y-%m-%dT%H:%M:%S.%f%z')
throws the following exception in Python 3.5.3 and 3.6.8
ValueError: time data '2019-07-21T08:54:32.115285+00:00' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'
but works fine in Python 3.7.3.
I checked the 3.5 documentation but couldn't spot any changes. Any ideas?
The %z directive only allows for a colon in the time zone starting with python 3.7.
See also here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With