【发布时间】:2018-05-23 19:42:19
【问题描述】:
我尝试将此日期字符串:Wed May 23 15:45:43 +0000 2018 转换为带有 strptime 的 python 日期对象。 我检查了我应该如何使用它,但我绝对不明白我的问题出在哪里。
我刚试过这个
date = datetime.strptime('Wed May 23 15:45:43 +0000 2018', '%a %b %d %x %z %Y')
它应该是正确的格式,但我收到了这个错误:
sre_constants.error: redefinition of group name 'd' as group 5; was group 3 at position 169
这是否意味着 23 不是 %d 格式?
感谢您的帮助
【问题讨论】:
标签: python-3.x strptime