擅长:python、mysql、java
<p>目前,还没有治愈的方法,这里是和解释:<a href="https://bugs.python.org/issue15873" rel="nofollow noreferrer">https://bugs.python.org/issue15873</a>更准确地说,这里是:<a href="https://bugs.python.org/msg169952" rel="nofollow noreferrer">https://bugs.python.org/msg169952</a>。
但你可以通过这种方式来解决这个问题:</p>
<pre><code>from datetime import datetime
d = "2015-04-30T23:59:59+00:00"
if ":" == d[-3:-2]:
d = d[:-3]+d[-2:]
print(datetime.strptime(d, "%Y-%m-%dT%H:%M:%S%z"))
</code></pre>