On Sat, 21 Jun 2003, Ben Bennett wrote:

> I saw that mail, but I meant yet another constructor that will take an
> ISO week number and day number (within the week) and a "year"
> construct the appropriate date.
>
> Note that the year given may not be the actual year the date falls in
> but is rather the ISO year number.  (For instance day 1 of week 1 of
> 2003 is 2002-12-30!)
>
> You can manaully do this by doing:
> --
> my $dt = DateTime->new(year => $year, month => 1, day => 4);
> my $adjustment =
>    ( ($week_num - 1) * 7   ) +
>    (  $day_num - 1         ) -
>    (  $dt->day_of_week - 1 );
> $dt->add($adjustment);

In which case this belongs in the DateTime::Format::ISO8601 module, since
the only people likely to want to construct an object based on
ISO week-year stuff are going to use that module anyway.

I can't think of any other usage which necessitates such a constructor.


-dave

/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/

Reply via email to