[英]Strange strptime error in python 3.5 and 3.6
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 在Python 3.5.3和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. 但在Python 3.7.3中工作正常。
I checked the 3.5 documentation but couldn't spot any changes. 我检查了3.5文档,但没有发现任何变化。 Any ideas?
有任何想法吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.