我的日期看起来像“2012-11-02 21:00:20.000397”,我在下面的代码中遇到了以下错误……谁能提供有关问题的输入?
代码:-
create_date = datetime.strptime(str(CRItem['CR Created Date']), '%Y-%m-%d %H:%M:%S')
CR_created_date = "{}/{}/{}".format(create_date.month,d.day,d.year)
CRMailBody = CRMailBody + "<tr>"
错误:-
Traceback (most recent call last):
File "test.py", line 482, in <module>
create_date = datetime.strptime(str(CRItem['CR Created Date']), '%Y-%m-%d %H:%M:%S')
File "C:\Python27\lib\_strptime.py", line 328, in _strptime
data_string[found.end():])
ValueError: unconverted data remains: .000397