Edit report at http://bugs.php.net/bug.php?id=51184&edit=1
ID: 51184 Comment by: php at twinmail dot de Reported by: s...@php.net Summary: DateInterval has incorrect days property on windows Status: Wont fix Type: Bug Package: Date/time related Operating System: Windows PHP Version: 5.3.2 Assigned To: pajoye Block user comment: N New Comment: 5.3.3 on WINNT is also affected. Previous Comments: ------------------------------------------------------------------------ [2010-06-14 12:50:44] paj...@php.net Sorry, I meant won't fix. It is not something we can easily fix, use the VC9 versions instead (apachelounge.com for the VC9 versions of apache). ------------------------------------------------------------------------ [2010-06-14 12:43:28] pluk77 at gmail dot com Is this bug closed because it is now fixed in VC6 as well, or because it is seen as not a bug? ------------------------------------------------------------------------ [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] s...@php.net VC6 NTS fails as well here. VC9 NTS works. ------------------------------------------------------------------------ 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