如果我运行以下命令:
from dateutil import parser
parser.parse("Wind10_463@Y2014_M11_D19", fuzzy=True)
我明白了:
datetime.datetime(2014, 12, 19, 0, 0)
为什么说十二月而不是十一月?
最佳答案
它无法完全解析字符串的结构。当 dateutil.parser.parse
缺少其中一个字段(例如月份)时,它将用当前月份(即十二月)填充。
default: If given, this must be a datetime instance. Any fields missing in the parsed date will be copied from > this instance. The default value is the current date, at 00:00:00am.
关于python - 为什么调用 dateutil.parser.parse 表明 11 月是 12 月?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27230503/