New submission from Valdemar Rolfsen <[email protected]>:
Inconsistency in strftime between python 3.6 and 3.7 when parsing first-century
dates.
Python 3.6
>>> datetime.datetime.strptime(d, "%Y-%m-%d").strftime("%Y-%m-%d")
'0020-10-05'
Python 3.7
>>> datetime.datetime.strptime("0020-10-05", "%Y-%m-%d").strftime("%Y-%m-%d")
'20-10-05'
This means that the following would work for 3.6 but raise a ValueError for 3.7:
>>> d = "0020-10-05"
>>> d = datetime.datetime.strptime(d, "%Y-%m-%d").strftime("%Y-%m-%d")
>>> d = datetime.datetime.strptime(d, "%Y-%m-%d").strftime("%Y-%m-%d")
----------
components: Library (Lib)
messages: 376296
nosy: belopolsky, p-ganssle, valdemarrolfsen
priority: normal
severity: normal
status: open
title: Inconcistent behaviour in strftime
type: behavior
versions: Python 3.7
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41702>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com