[issue13305] datetime.strftime("%Y") not consistent for years < 1000

Florent Xicluna report at bugs.python.org
Mon Oct 31 21:12:37 CET 2011


New submission from Florent Xicluna <florent.xicluna at gmail.com>:

See msg146725 on issue 13291.

on linux
>>> datetime(1,  2, 10, 11, 41, 23).strftime("%Y")
'1'

on osx
>>> datetime(1,  2, 10, 11, 41, 23).strftime("%Y")
'0001'


>>> datetime.strptime('0001', '%Y')
datetime.datetime(1, 1, 1, 0, 0)

>>> datetime.strptime('1', '%Y')
ValueError: time data '1' does not match format '%Y'

----------
components: Library (Lib)
messages: 146740
nosy: flox
priority: normal
severity: normal
stage: test needed
status: open
title: datetime.strftime("%Y") not consistent for years < 1000
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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


More information about the Python-bugs-list mailing list