[issue14423] Getting the starting date of iso week from a week number and a year.

Marc-Andre Lemburg report at bugs.python.org
Tue Apr 10 01:28:42 CEST 2012


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Alexander Belopolsky wrote:
> 
> Alexander Belopolsky <alexander.belopolsky at gmail.com> added the comment:
> 
> On Mon, Apr 9, 2012 at 6:20 PM, Marc-Andre Lemburg
> <report at bugs.python.org> wrote:
>> Which is wrong, since the start of the first ISO week of a year
>> can in fact start in the preceeding year...
> 
> Hmm, the dateutil documentation seems to imply that relativedelta
> takes care of this:
> 
> http://labix.org/python-dateutil#head-72c4689ec5608067d118b9143cef6bdffb6dad4e
> 
> (Search the page for "ISO")

That's not realtivedelta taking care of it, it's the way it is
used: the week with 4.1. in it is the first ISO week of a year;
it then goes back to the previous Monday and adds 14 weeks from
there to go to the Monday of the 15th week. This works fine as
long as 4.1. doesn't fall on a Monday...

You don't really expect anyone to remember such rules, do you ? :-)

----------

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


More information about the Python-bugs-list mailing list