[issue12006] strptime should implement %V or %u directive from libc

Ashley Anderson report at bugs.python.org
Thu May 26 21:16:43 CEST 2011


Ashley Anderson <aganders3 at gmail.com> added the comment:

The example that triggered the issue in testing was January 1, 1905. The ISO date for this day is 1904 52 7. This is reported correctly if you use datetime.isocalendar() or datetime.strftime('%G'), but you get 1905 if you use datetime.strftime('%Y'). When it's read back in it causes the test to fail because ISO '1904 52 7' is different from ISO '1905 52 7'.

Likewise if you consider a year starting on a Tuesday, Wednesday, or Thursday, there will be several days at the end of the previous year that will have an ISO year ahead of their Gregorian representation.

----------

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


More information about the Python-bugs-list mailing list