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: 2017-10-24 07:52 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:
Status: Open Package: Date/time related
PHP Version: 5.3.2 OS: Win 7 Pro
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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:
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC