Python: 时间数据 '19. Mai 2020' 与格式 '%d. %经过'

Python: time data '19. Mai 2020' does not match format '%d. %b %Y'

我不知道为什么这行不通..

这是我的代码:

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!

如果设置了适当的语言环境,strptime 将遵守:

>>> locale.setlocale(locale.LC_ALL, "de_DE")
'de_DE'
>>> datetime.strptime("19. Mai 2020", "%d. %B %Y")
datetime.datetime(2020, 5, 19, 0, 0)