I have the statements:
v = datetime.strptime('2020-07-08T09:00:01+00:00', '%Y-%m-%dT%H:%M:%S%z')
print(v)
The part that doesn't work is the timezone. I know this because it works find if I don't use the timezone.
v = datetime.strptime('2020-07-08T09:00:01', '%Y-%m-%dT%H:%M:%S')
This works as I expect in Jupyter; however, I can't get it to work in PyCharm. PyCharm configured to use a VE. Not using the same version of python.
It returns the error:
ValueError: time data '2020-07-08T09:00:01+00:00' does not match format '%Y-%m-%dT%H:%M:%S%z'
In PyCharm console:
print (sys.version_info)
sys.version_info(major=3, minor=6, micro=8, releaselevel='final', serial=0)
In Jupiter
print (sys.version_info)
sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)
Is there some other way to do this? A different code? Am I missing something?