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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
36 + 8 = ?
Subscribe to this entry?

 
 [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: Thu Apr 18 12:01:28 2024 UTC