[issue32195] datetime.strftime with %Y no longer outputs leading zeros

Dave Challis report at bugs.python.org
Fri Dec 1 14:05:42 EST 2017


Dave Challis <suicas at gmail.com> added the comment:

My mistake, it appears to be related to the OS it's running on rather than the version (I just happened to test with different versions on different OSes).

On Mac OS X (with 3.6.2):

    >>> import datetime
    >>> datetime.datetime.min.strftime('%Y')
    '0001'

On Linux (with 3.6.2 again):

    >>> import datetime
    >>> datetime.datetime.min.strftime('%Y')
    '1

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32195>
_______________________________________


More information about the Python-bugs-list mailing list