Bug #53880 [Opn->Dup]: date_diff returns wrong results
| From: | danielc@php.net | Date: | Mon, 21 Nov 2011 03:01:28 +0000 |
| Subject: | Bug #53880 [Opn->Dup]: date_diff returns wrong results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-165389@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=53880&edit=1
ID: 53880
Updated by: danielc@php.net
Reported by: an0nym at narod dot ru
Summary: date_diff returns wrong results
-Status: Open
+Status: Duplicate
Type: Bug
Package: Date/time related
Operating System: Windows Server 2008 R2 x64
PHP Version: 5.3.5
-Assigned To:
+Assigned To: danielc
Block user comment: N
Private report: N
New Comment:
This is a duplicate of http://bugs.php.net/bug.php?id=51184
Previous Comments:
------------------------------------------------------------------------
[2011-05-08 11:48:46] eikcam at internode dot on dot net
I'm running Windows 7 64-bit and I am having this issue.
DateInterval Object ( [y] => 0 [m] => 1 [d] => 30 [h] => 0 [i] => 0 [s] => 0
[invert] => 0 [days] => 6015 )
------------------------------------------------------------------------
[2011-01-30 15:12:45] an0nym at narod dot ru
Pay attention to the end of description. Windows 7 x64 doesn't have this bug,
while Windows Server 2008 R2 do and they have much more simiral codebase than
Windows XP and Windows Server 2008 R2.
------------------------------------------------------------------------
[2011-01-30 15:09:38] an0nym at narod dot ru
I didn't compile myself. I downloaded VC6 x86 thread safe from windows binaries
php download page.
------------------------------------------------------------------------
[2011-01-30 10:53:57] stas@php.net
Works fine for me on XP 32-bit with VC9. Which compiler/build did you use?
------------------------------------------------------------------------
[2011-01-29 23:42:08] an0nym at narod dot ru
Description:
------------
See test script.
On FreeBSD 8.1-RELEASE-p1 amd64, Linux 2.6.18-194.32.1.el5 x86_64, Windows 7 x64
everything works fine.
Test script:
---------------
date_default_timezone_set("UTC");
$d = new DateTime("2011-01-01");
echo $d->diff(new DateTime("2010-01-01"))->format("%a");
Expected result:
----------------
365
Actual result:
--------------
6015
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=53880&edit=1