Bug #53880 [Com]: date_diff returns wrong results
| From: | eikcam at internode dot on dot net | Date: | Sun, 08 May 2011 09:48:46 +0000 |
| Subject: | Bug #53880 [Com]: date_diff returns wrong results | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-160601@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
Comment by: eikcam at internode dot on dot net
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:
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 )
Previous Comments:
------------------------------------------------------------------------
[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 http://bugs.php.net/bug.php?id=53880&edit=1