php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44404 strtotime('last Sunday') broken after DST change
Submitted: 2008-03-11 02:31 UTC Modified: 2008-03-18 12:40 UTC
Votes:4
Avg. Score:3.0 ± 1.4
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:0 (0.0%)
From: gdonald at gmail dot com Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 4.4.8 OS: Debian GNU/Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gdonald at gmail dot com
New email:
PHP Version: OS:

 

 [2008-03-11 02:31 UTC] gdonald at gmail dot com
Description:
------------
strtotime( 'last Sunday' ) produces an incorrect value.

Reproduce code:
---------------
echo "Current time():\n";
echo date( 'Y-m-d H:i:s', time() );
echo "\nBroken strtotime( 'last Sunday' )\n";
echo date( 'Y-m-d H:i:s', strtotime( 'last Sunday' ) );
echo "\n";

Expected result:
----------------
I expect to see the date 2008-03-09, the correct value for strtotime( 'last Sunday' ), today being 2008-03-10, a Monday.

Actual result:
--------------
strtotime( 'last Sunday' ) produces 2008-03-08 23:00:00, a value one hour short of correct.  Seems like an issue with the recent daylight savings time change.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-18 12:40 UTC] derick@php.net
We are sorry, but we can not support PHP 4 related problems anymore.
Momentum is gathering for PHP 6, and we think supporting PHP 4 will
lead to a waste of resources which we want to put into getting PHP 6
ready.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 09:01:28 2024 UTC