转换时出现价值错误,
from datetime import datetime
b="Sep 23 09:53:38 2019 GMT"
date = datetime.strptime(b, "%d %b %Y")
print(date)
您必须完全分解时间字符串才能获得日期时间:
date = datetime.strptime(b, "%b %d %H:%M:%S %Y %Z")
datetime.datetime(2019、9、23、9、53、38)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句