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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sat Dec 21 18:01:29 2024 UTC