Edit report at https://bugs.php.net/bug.php?id=66257&edit=1
ID: 66257
Updated by: derick@php.net
Reported by: mfaust at usiwireless dot com
Summary: strtotime doesn't use current timezone on '4
thursdays'
-Status: Assigned
+Status: Duplicate
Type: Bug
Package: Date/time related
Operating System: Linux
PHP Version: 5.6.8
Assigned To: derick
Block user comment: N
Private report: N
New Comment:
Support for "thursdays" (with the extra "s") will be part of PHP 8.1.8 and PHP
8.2 once there is a new timelib release with https://github.com/derickr/timelib/commit/cb26187fb6033a80d4bae4883ee6b62eebfd4856
in it.
This makes this issue a duplicate of #51934, and hence I'm closing it.
Previous Comments:
------------------------------------------------------------------------
[2021-10-01 14:08:43] cmb@php.net
> Plural of day names are not supported by timelib, [â¦]
Spot on! Thank you for the detailed analysis!
> It could do with a few more examples, or a pointer to the> regexes used in the implementation.
There is already documentation about the supported date and time
formats[1], and this page is linked from the parameter's
description. It seems to me that adding the parameter name to the
function description, so that it'll be linked to the parameter's
description, should be sufficient.
> In any case I suggest the test case for this bug be removed from> the test suite.
Good catch! <https://github.com/php/php-src/pull/7543>
[1] <https://www.php.net/manual/en/datetime.formats.php>
------------------------------------------------------------------------
[2021-07-28 11:21:57] d at ja dot vu
Plural of day names are not supported by timelib, so '4 thursdays' will be interpreted as:
'the fourth Thursday, in the "s" - sierra - time zone'
The sierra time zone is UTC-6, and that overlaps with America/Chicago for parts of the year.
I think this should be reclassified as a documentation problem.
The claim on the strtotime page that it will 'Parse about any English textual datetime
description into a Unix timestamp' is not very specific, and other time units do support the
plural form. It could do with a few more examples, or a pointer to the regexes used in the
implementation.
Alternatively I can provide a few-line patch to add the plural of week names, but that will break
BC.
However I do not think many people even know about the one letter time zones, except for Zulu, and
even fewer will actually use it.
In any case I suggest the test case for this bug be removed from the test suite.
------------------------------------------------------------------------
[2015-04-29 19:58:52] cmb@php.net
Interestingly, the issue is timezone related. It doesn't happen for
America/Chicago, but for UTC, for instance[1].
[1] <http://3v4l.org/LLkCE>
------------------------------------------------------------------------
[2014-12-30 16:52:29] mfaust at usiwireless dot com
sorry, I meant "re-opened"
------------------------------------------------------------------------
[2014-12-30 16:52:07] mfaust at usiwireless dot com
I am unable to change the status back to "unopened" due to "ERROR:
You aren't allowed to change a bug to that state."
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=66257
--
Edit this bug report at https://bugs.php.net/bug.php?id=66257&edit=1