Edit report at http://bugs.php.net/bug.php?id=51184&edit=1
ID: 51184
Comment by: pluk77 at gmail dot com
Reported by: seld@php.net
Summary: DateInterval has incorrect days property on windows
Status: Closed
Type: Bug
Package: Date/time related
Operating System: Windows
PHP Version: 5.3.2
Assigned To: pajoye
New Comment:
Is this bug closed because it is now fixed in VC6 as well, or because it
is seen as not a bug?
Previous Comments:
------------------------------------------------------------------------
[2010-06-05 04:14:23] ric dot lombardi at gmail dot com
randy, this is not a bug. the format %d just shows the difference
between the two
day numbers.
If you want the absolute days difference between the dates, you have to
use "%a"
as format.
------------------------------------------------------------------------
[2010-06-04 22:40:51] randy dot larson at veracitynetworks dot com
I have with PHP 5.3.2 on Cent OS 5.4 running the following code from the
CLI:
$datetime1 = new DateTime('2009-10-11');
$datetime2 = new DateTime('2009-11-13');
$interval = $datetime1->sub($datetime2);
echo $interval->format('%R%d days');
This prints "+2 days" where it should print "+33 days". It appears that
it doesn't add the month.
------------------------------------------------------------------------
[2010-05-19 16:20:08] seld@php.net
VC6 NTS fails as well here. VC9 NTS works.
------------------------------------------------------------------------
[2010-05-19 15:45:07] pluk77 at gmail dot com
Done so. Tested the VC6 and VC9 builds. The VC6 build still has this bug
while the VC9 does not.
------------------------------------------------------------------------
[2010-05-19 15:22:51] seld@php.net
Can you try with VC9? Works here on latest VC9 Non Thread Safe
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/bug.php?id=51184--
Edit this bug report at http://bugs.php.net/bug.php?id=51184&edit=1