我有以下日期字符串:'3 févr. 2015 年 14:26:00 CET'
datetime.datetime.strptime('03 févr. 2015 14:26:00', '%d %b %Y %H:%M:%S')
解析失败并出现错误:
ValueError: time data '03 f\xc3\xa9vr. 2015 14:26:00' does not match format '%d %b %Y %H:%M:%S'
我尝试使用以下命令遍历所有语言环境locale.locale_alias
:
for l in locale.locale_alias:
try:
locale.setlocale(locale.LC_TIME, l)
print l,datetime.datetime.strptime('03 févr. 2015 14:26:00', '%d %b %Y %H:%M:%S')
break
except Exception as e:
print e
但我找不到正确的。