Bug #53880 [Opn]: date_diff returns wrong results
| From: | an0nym at narod dot ru | Date: | Sun, 30 Jan 2011 14:12:45 +0000 |
| Subject: | Bug #53880 [Opn]: date_diff returns wrong results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-158345@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53880&edit=1
ID: 53880
User updated by: an0nym at narod dot ru
Reported by: an0nym at narod dot ru
Summary: date_diff returns wrong results
Status: Open
Type: Bug
Package: Date/time related
Operating System: Windows Server 2008 R2 x64
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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 http://bugs.php.net/bug.php?id=53880&edit=1