Bug #67853 [NEW]: strtotime() incorrect handles relative dates
| From: | bugs at oliverboorman dot biz | Date: | Sun, 17 Aug 2014 19:34:44 +0000 |
| Subject: | Bug #67853 [NEW]: strtotime() incorrect handles relative dates | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187157@lists.php.net to get a copy of this message | ||
From: bugs at oliverboorman dot biz
Operating system: Windows
PHP version: Irrelevant
Package: Date/time related
Bug Type: Bug
Bug description:strtotime() incorrect handles relative dates
Description:
------------
When passing date strings such as "second Saturday August 2015" to
strtotime(), the wrong output is returned. The "first", "second" or
"third" qualifiers seem to use the wrong index in certain cases.
For example, in 2015, the first day of August will be a Saturday so this
should be considered the first Saturday of August. However, the function
seems to treat it as the zeroth Saturday.
Test script:
---------------
$test = strtotime("second Saturday August 2015");
echo date("d M Y h:i" $test);
Expected result:
----------------
08 Aug 2015 12:00
Actual result:
--------------
15 Aug 2015 12:00
--
Edit bug report at https://bugs.php.net/bug.php?id=67853&edit=1
--