[issue19162] datetime.datetime.min.strftime('%Y') not working

tomasz.zaleski report at bugs.python.org
Fri Oct 4 13:52:02 CEST 2013


tomasz.zaleski added the comment:

works correctly on python3.3:
Python 3.3.2 (default, Oct  4 2013, 12:21:07)
[GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.min.strftime('%Y')
'0001'

issue on 2.7:
Python 2.7.5 (default, Sep 17 2013, 12:11:31)
[GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd9
Type "help", "copyright", "credits" or "license" for more information.
>>> import datetime
>>> datetime.datetime.min.strftime('%Y')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: year=1 is before 1900; the datetime strftime() methods require year >= 1900

----------
nosy: +krzaq

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19162>
_______________________________________


More information about the Python-bugs-list mailing list