[issue30802] datetime.datetime.strptime('200722', '%Y%U')

Matthew Barnett report at bugs.python.org
Tue Jul 25 13:35:16 EDT 2017


Matthew Barnett added the comment:

I think the relevant standard is ISO 8601:

https://en.wikipedia.org/wiki/ISO_8601

The first day of the week is Monday.

Note particularly the examples it gives:

    Monday 29 December 2008 is written "2009-W01-1"
    Sunday 3 January 2010 is written "2009-W53-7"

So the first few days of January can be in the last week of the previous year!

----------

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


More information about the Python-bugs-list mailing list