Bug #71725 [Opn->Csd]: Incorrect ordinal suffix used for 29th February
| From: | daniel at honestempire dot com | Date: | Sun, 06 Mar 2016 22:46:08 +0000 |
| Subject: | Bug #71725 [Opn->Csd]: Incorrect ordinal suffix used for 29th February | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-199634@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=71725&edit=1
ID: 71725
User updated by: daniel at honestempire dot com
Reported by: daniel at honestempire dot com
Summary: Incorrect ordinal suffix used for 29th February
-Status: Open
+Status: Closed
Type: Bug
Package: Calendar related
Operating System: Mac OS X
PHP Version: 7.0.4
Block user comment: N
Private report: N
New Comment:
It would appear the ordinal is parsed before the t flag, removing the ordinal fixes my issue.
Previous Comments:
------------------------------------------------------------------------
[2016-03-06 22:27:17] daniel at honestempire dot com
Description:
------------
When attempting to find the last weekday of February 2016, I stumbled across this bug. See the test
script for replication information.
Test script:
---------------
$lastDayOfMonth = date('tS F Y', strtotime('2016-02-01 12:00:00'));
var_dump($lastDayOfMonth); // string(18) "29st February 2016"
var_dump(date('d', strtotime(sprintf('last weekday %s', $lastDayOfMonth)))); //
string(2) "26" (should be string(2) "29")
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=71725&edit=1