php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #51934 strtotime plurals / incorrect time
Submitted: 2010-05-27 19:18 UTC Modified: 2022-05-13 10:57 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: brent dot hansen at gmail dot com Assigned: derick (profile)
Status: Closed Package: Date/time related
PHP Version: 5.3.2 OS: Win 7 Pro
Private report: No CVE-ID: None
 [2010-05-27 19:18 UTC] brent dot hansen at gmail dot com
Description:
------------
Pluralization seems to remove 1 hour from calculation or drops daylight savings adjustment.

Notes:
date.timezone = America/Los_Angeles
Correction to PHP version: 5.3.1

Test script:
---------------
date("Y-m-d H:i:s",strtotime("4 Sunday ago"));
date("Y-m-d H:i:s",strtotime("4 Sundays ago"));

Expected result:
----------------
2010-05-01 00:00:00
2010-05-01 00:00:00

Actual result:
--------------
2010-05-01 00:00:00
2010-04-30 23:00:00

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-03 13:11 UTC] sjoerd@php.net
It interprets the S as Sierra Time Zone. Similar to:
echo date("Y-m-d H:i:s",strtotime("4 SundayPST ago"));
 [2010-06-03 13:52 UTC] derick@php.net
-Type: Bug +Type: Feature/Change Request -Assigned To: +Assigned To: derick
 [2010-06-03 13:52 UTC] derick@php.net
Changing this to a feature request instead
 [2017-10-24 07:52 UTC] kalle@php.net
-Status: Assigned +Status: Open -Assigned To: derick +Assigned To:
 [2021-08-11 11:03 UTC] cmb@php.net
For reference: <https://3v4l.org/T6m7S>.
 [2022-05-13 10:57 UTC] derick@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: derick
 [2022-05-13 10:57 UTC] derick@php.net
Fixed in the dependent 'timelib' library, likely for PHP 8.1.7 or 8.1.1, depending on timing.
 [2022-05-20 12:25 UTC] git@php.net
Automatic comment on behalf of derickr
Revision: https://github.com/php/php-src/commit/23dbefdb7bf328587200a1642bd69efd55474619
Log: Fixed bug #51934 (strtotime plurals / incorrect time)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC