Bug #67706 [Opn]: strtotime goes wrong for "last day of February next year"
| From: | derick@php.net | Date: | Tue, 29 Jul 2014 10:39:57 +0000 |
| Subject: | Bug #67706 [Opn]: strtotime goes wrong for "last day of February next year" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-186860@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=67706&edit=1
ID: 67706
Updated by: derick@php.net
Reported by: greenrover33 at gmail dot com
Summary: strtotime goes wrong for "last day of February next
year"
Status: Open
Type: Bug
Package: Date/time related
Operating System: Linux/Independent
PHP Version: 5.6Git-2014-07-29 (Git)
-Assigned To:
+Assigned To: derick
Block user comment: N
Private report: N
New Comment:
You're right - this needs looking at.
Previous Comments:
------------------------------------------------------------------------
[2014-07-29 09:48:17] greenrover33 at gmail dot com
I have seen this Report:
https://bugs.php.net/bug.php?id=50048
But different to them is, that i give a relative year.
Normaly it should translate the date first before it tries to resolve the day.
------------------------------------------------------------------------
[2014-07-29 09:42:40] greenrover33 at gmail dot com
Description:
------------
strtotime goes wrong for "last day of February next year"
"last day of February next year" got the 31.03 the last day of march as result.
Test script:
---------------
$bug_from = 1406625924; // 29.07.2014 11:25
echo strftime('%d.%m.%Y %H:%M:%S', strtotime('last day of February next year',
$bug_from));
echo ' != ';
echo strftime('%d.%m.%Y %H:%M:%S', strtotime('last day of February 2015',
$bug_from));
die();
Expected result:
----------------
28.02.2015 00:00:00 != 28.02.2015 00:00:00
Actual result:
--------------
31.03.2015 00:00:00 != 28.02.2015 00:00:00
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=67706&edit=1