我收到了以下格式的日期时间
timestamp = '2019-03-18 01:50:00 -0800'
想在python中转换成datetime 我尝试过,但无法选择UTC偏移量
^{pr2}$我得到的错误
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/_strptime.py", line 324, in _strptime
(bad_directive, format))
ValueError: 'z' is a bad directive in format '%Y-%m-%d %H:%M:%S %z'
如何在python2.7中选择UTC偏移量?在
安装pytz库
将pytz导入代码
^{pr2}$应该有帮助。在
只需使用dateutil
相关问题 更多 >
编程相关推荐