我的日期看起来像“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