Bug #66485 [Asn->Dup]: 01.01.2014 diff 01.02.2014 is 30 days instead of 1 month
| From: | heiglandreas@php.net | Date: | Mon, 24 Apr 2017 15:52:10 +0000 |
| Subject: | Bug #66485 [Asn->Dup]: 01.01.2014 diff 01.02.2014 is 30 days instead of 1 month | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208745@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66485&edit=1
ID: 66485
Updated by: heiglandreas@php.net
Reported by: kuba at pdesign dot pl
Summary: 01.01.2014 diff 01.02.2014 is 30 days instead of 1
month
-Status: Assigned
+Status: Duplicate
Type: Bug
Package: Date/time related
Operating System: Windows 7
PHP Version: 5.5.8
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
This looks like a duplicate of https://bugs.php.net/bug.php?id=52480
Previous Comments:
------------------------------------------------------------------------
[2015-11-09 08:23:26] jimmy dot gaussen at gmail dot com
Hi,
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:
https://www.reddit.com/r/PHPhelp/comments/3r7so6/weird_datetimediff_interaction_with_time_zones/
------------------------------------------------------------------------
[2014-01-14 12:44:58] kuba at pdesign dot pl
Description:
------------
---
From manual page: http://www.php.net/datetime.diff
---
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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66485&edit=1