php - Strange bug of date_modify function in DateTime class -


i use native php datetime class adding days dates. when dealing negative dates, encountered strange bug. depending on millennium added or day or two. example:

$date_one = date_create("-1000-12-27"); date_modify($date_one, '+1 day'); //return datetime object ( [date] => -1000-12-29 00:00:00 )   $date_two = date_create("-2000-12-27"); date_modify($date_two, '+1 day'); //return datetime object ( [date] => -2000-12-28 00:00:00 )   $date_three = date_create("-3000-12-27"); date_modify($date_three, '+1 day'); //return datetime object ( [date] => -3000-12-29 00:00:00 ) 

that is, depending on parity of millennium issue, or december 28 or december 29. why happening? problem?


Comments

Popular posts from this blog

javascript - Google App Script ContentService downloadAsFile not working -

javascript - Function overwritting -

c# - Exception when attempting to modify Dictionary -