> -----Original Message-----
> From: Rick Measham [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, September 01, 2004 3:07 PM
> To: Bruce Van Allen; [EMAIL PROTECTED]
> Cc: Dave Rolsky
> Subject: Re: Problems with (and patch for) February 30th in
> t/006_locales.t in DateTime::Format::Strptime 1.06
>
>
> At 2:51 pm -0700 2004-09-01, Bruce Van Allen wrote:
> >Pace that, the list had extensive discussion early on about
> specifying
> >end-of-month handling when doing date calcs. Hence the
> 'wrap', 'limit',
> >and 'preserve' modes for the end_of_month parameter in DT::Duration.
> >
> >Absent such a parameter, no date calculation would be correct in the
> >usual meaning of 'correct'.
>
>
> I've realised my mistake, and withdraw my request from a few days
> back. I agree that in date math there should be the right behaviour,
> however this wasn't in the math it was in a set.
>     $dt->set( month=>2, day=>30 );
>
> Now you either typed in the wrong thing there or you made a
> mistake like I did:
> for (1..12){
>       $dt->set( month=>$_, day=>30)
> }
>
> It's right to cause a die there because DT has no idea what I'm
> doing. I may have entered static value as in the top, or I might be
> using a rolling variable as in the bottom. If I'm using a rolling
> value I should be relying on date math, not a for loop.
>
> The fix is as simple as either specifying a day that is in every
> month, or using date math and just adding a month (with limit or
> preserve)

Now throw that in a doc somewhere (perhaps a FAQ?) so that this nugget is
captured for posterity.  :)

-ofer

Reply via email to