On Mar 1, 2012, at 17:14, <[email protected]> wrote:

> If the date for $dt is 20120229, the following produces an error!
> 
> $dt->set_year($dt1->year + 1);
> 
> Invalid day of month (day = 29 - month = 2) 
>  at /sbcimp/run/pd/cpan/5.8.8-2006.03/lib/DateTime.pm line 170  
>     DateTime::new('undef', 'hour', 0, 'second', 0, 'month', 2, 'locale', 
> 'DateTime::Locale::en_US=HASH(0x8e15400)', ...) called at 
> /sbcimp/run/pd/cpan/\
> 
> 5.8.8-2006.03/lib/DateTime.pm line 1507 
>     DateTime::set('undef', 'year', 2013) called at 
> /sbcimp/run/pd/cpan/5.8.8-2006.03/lib/DateTime.pm line 1514
> 
Yeah. That was the subject of days of discussion as to what the right thing to 
do here was. Leap years are hard. This is what we decided was the right thing 
to do here. 

--
Rich Bowen, mobile edition


Reply via email to