|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patches52798 (last revision 2010-09-23 06:22 UTC by akabirov at rambler dot ru)date_diff (last revision 2010-09-08 16:03 UTC by cataphract@php.net) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-09-08 17:36 UTC] cataphract@php.net
-Status: Open
+Status: Verified
-Assigned To:
+Assigned To: derick
[2010-09-08 17:36 UTC] cataphract@php.net
[2010-09-08 18:03 UTC] cataphract@php.net
[2010-09-08 18:12 UTC] cataphract@php.net
[2011-01-30 10:49 UTC] stas@php.net
-Status: Verified
+Status: Feedback
[2011-01-30 10:49 UTC] stas@php.net
[2011-01-30 11:22 UTC] stas@php.net
[2012-02-24 17:51 UTC] kissifrot at gmail dot com
[2013-02-18 00:34 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 10 02:00:01 2025 UTC |
Description: ------------ I have a probleme with the function diff of dateTime. When i do a test, the "days" result is always : 6015. All the other informations ( Y, m, d, ... ) are correct. Have-you an idea ? Test script: --------------- Exemple : $date1 = new DateTime('2010-01-01'); $date2 = new DateTime('2010-03-13'); $interval = $date2->diff($date1); Zend_Debug::dump($interval); //OR Zend_Debug::dump($interval->format('%a')); ------------------ Result : object(DateInterval)#174 (8) { ["y"] => int(0) ["m"] => int(2) ["d"] => int(12) ["h"] => int(0) ["i"] => int(0) ["s"] => int(0) ["invert"] => int(0) ["days"] => int(6015) } Expected result: ---------------- days => 71 Actual result: -------------- days => 6015