Subject: | adding extremely large number of days fails (related to leap years) |
Here is a failing code:
the failure is: Invalid day of month (day = 30 - month = 2 - year = 735200)
I am using: perl 5.18.2 (MSWin32 / x86) + DateTime 1.10
--
kmx
use DateTime; my $DAY_ONE = DateTime->new(year => 0, month => 1, day => 1); warn $DAY_ONE->clone->add(days => 268526343)->ymd, "\n"; # 735200-02-27 warn $DAY_ONE->clone->add(days => 268526344)->ymd, "\n"; # 735200-02-28 warn eval { $DAY_ONE->clone->add(days => 268526345)->ymd }; # FAILS (should be 735200-02-29) warn $DAY_ONE->clone->add(days => 268526346)->ymd, "\n"; # 735200-03-01 warn $DAY_ONE->clone->add(days => 268526347)->ymd, "\n"; # 735200-03-02
the failure is: Invalid day of month (day = 30 - month = 2 - year = 735200)
I am using: perl 5.18.2 (MSWin32 / x86) + DateTime 1.10
--
kmx