我不知道,为什么这不起作用..
这是我的代码:
from datetime import datetime
d = "19. Mai 2020"
date1 = datetime.strptime(d, "%d. %B %Y")
结果,我收到以下错误代码:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-27-78591e667c99> in <module>()
----> 1 date1 = datetime.strptime(s, "%d. %B %Y")
1 frames
/usr/lib/python3.6/_strptime.py in _strptime(data_string, format)
360 if not found:
361 raise ValueError("time data %r does not match format %r" %
--> 362 (data_string, format))
363 if len(data_string) != found.end():
364 raise ValueError("unconverted data remains: %s" %
ValueError: time data '19. Mai 2020' does not match format '%d. %B %Y'
在学习了几个教程 48 小时后,我仍然没有头绪......
希望你们中的一个人确实看到了我的..错误?
问候,P!