|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66485 01.01.2014 diff 01.02.2014 is 30 days instead of 1 month
Submitted: 2014-01-14 12:44 UTC Modified: 2017-04-24 15:52 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (50.0%)
From: kuba at pdesign dot pl Assigned: derick (profile)
Status: Duplicate Package: Date/time related
PHP Version: 5.5.8 OS: Windows 7
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: kuba at pdesign dot pl
New email:
PHP Version: OS:


 [2014-01-14 12:44 UTC] kuba at pdesign dot pl
From manual page:

see the actual result

Test script:
// date format DD-MM-YYYY
$start = new DateTime('01-02-2014');
$stop = new DateTime('01-03-2014');
$diff = $start->diff($stop);
echo $diff->format('%d days %m months');

Expected result:
0 days 1 months

Actual result:
28 days 0 months


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-01-14 13:11 UTC]
-Assigned To: +Assigned To: derick
 [2014-11-19 09:02 UTC]
-Package: Output Control +Package: Date/time related
 [2015-11-09 08:23 UTC] jimmy dot gaussen at gmail dot com

I had the same issue on 5.6.10, on Linux and Winndows. I tried to do some research on it, here is the dead r/PHPHelp thread I opened:
 [2017-04-24 15:52 UTC]
-Status: Assigned +Status: Duplicate
 [2017-04-24 15:52 UTC]
This looks like a duplicate of
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Feb 23 17:01:28 2020 UTC