【发布时间】:2012-03-15 02:04:08
【问题描述】:
我正在使用 Paypal API,并获得以下格式的时间戳。我尝试使用 strptime 将其解析为 datetime 对象,但出现以下错误:
(Pdb) datetime.strptime('2012-03-01T10:00:00Z','%Y-%M-%dT%H:%M:%SZ')
*** error: redefinition of group name 'M' as group 5; was group 2
另外,由于这种格式应该是相当标准的格式,难道没有可用的函数吗?
编辑:
好的,似乎是一个错字。第一个 %M 应该是 %m
【问题讨论】:
标签: python python-2.7