|  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
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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2008-03-11 02:31 UTC] gdonald at gmail dot com
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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-18 12:40 UTC]
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
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 14 18:01:29 2024 UTC