Bug #76397 [Opn->Nab]: -n month is not sequential
| From: | requinix@php.net | Date: | Thu, 31 May 2018 16:03:29 +0000 |
| Subject: | Bug #76397 [Opn->Nab]: -n month is not sequential | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-215457@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76397&edit=1
ID: 76397
Updated by: requinix@php.net
Reported by: i at cmsis dot me
Summary: -n month is not sequential
-Status: Open
+Status: Not a bug
Type: Bug
Package: Date/time related
Operating System: linux
PHP Version: 5.6.36
Block user comment: N
Private report: N
New Comment:
May 31st - 1 month = April 31st which doesn't exist and so overflows to May 1st.
May 31st - 2 months = March 31st which does exist.
Previous Comments:
------------------------------------------------------------------------
[2018-05-31 15:58:50] i at cmsis dot me
Description:
------------
on 05-31 run strtotime('-1 month') and strtotime('-2 month') the month is not
sequential
Test script:
---------------
echo date('Y-m-d H:i:s', strtotime('-1 month')) . "\n";
echo date('Y-m-d H:i:s', strtotime('-2 month')) . "\n";
Expected result:
----------------
the month should be sequential
Actual result:
--------------
-1 month for 05
and -2 month for 03
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76397&edit=1