# New Ticket Created by  Alex Jakimenko 
# Please include the string:  [perl #125686]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=125686 >


Code:
say DateTime.new('1994-05-03T12:00:00Z').later(days => 536106030).perl; # OK
say DateTime.new('1994-05-03T12:00:00Z').later(days => 536106031).perl; #
Boom!

Result:
DateTime.new(year => 1469802, month => 10, day => 17, hour => 12, minute =>
0, second => 0)
month out of range. Is: 7017915, should be in 1..12
  in block <unit> at ./test.pl:3

Similar bug: https://rt.perl.org/Public/Bug/Display.html?id=125682

Please note that there is the same problem with negative offsets:
Code:
say DateTime.new('2015-12-24T12:23:00Z').later(days => -537643698); # OK
say DateTime.new('2015-12-24T12:23:00Z').later(days => -537643699); # Boom!

Result:
-1470003-07-13T12:23:00Z
month out of range. Is: -7017910, should be in 1..12
  in block <unit> at ./test.pl:3

Reply via email to