|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-11-07 13:12 UTC] aharvey@php.net
-Status: Open
+Status: Feedback
[2014-11-07 13:12 UTC] aharvey@php.net
[2014-11-07 13:40 UTC] xguiga at gmail dot com
-Status: Feedback
+Status: Open
[2014-11-07 13:40 UTC] xguiga at gmail dot com
[2014-11-07 13:51 UTC] aharvey@php.net
-Status: Open
+Status: Not a bug
[2014-11-07 13:51 UTC] aharvey@php.net
[2014-11-07 15:05 UTC] xguiga at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 16:00:01 2025 UTC |
Description: ------------ I tried make an diff in 1899-01-01 and 1970-01-01 and don't return only year difference, return months, days, hours, minutes and seconds. I made some tests, and date before 1915 this happend. Test script: --------------- var_dump((new \DateTime('1912-01-01'))->diff(new \DateTime('1915-01-01'))); Expected result: ---------------- object(DateInterval)[2405] public 'y' => int 3 public 'm' => int 0 public 'd' => int 0 public 'h' => int 0 public 'i' => int 0 public 's' => int 0 public 'weekday' => int 0 public 'weekday_behavior' => int 0 public 'first_last_day_of' => int 0 public 'invert' => int 0 public 'days' => int 1095 public 'special_type' => int 0 public 'special_amount' => int 0 public 'have_weekday_relative' => int 0 public 'have_special_relative' => int 0 Actual result: -------------- object(DateInterval)[2405] public 'y' => int 2 public 'm' => int 11 public 'd' => int 30 public 'h' => int 23 public 'i' => int 53 public 's' => int 32 public 'weekday' => int 0 public 'weekday_behavior' => int 0 public 'first_last_day_of' => int 0 public 'invert' => int 0 public 'days' => int 1095 public 'special_type' => int 0 public 'special_amount' => int 0 public 'have_weekday_relative' => int 0 public 'have_special_relative' => int 0