php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37940 strtotime("last Sunday") produces a Saturday date sometimes
Submitted: 2006-06-28 02:17 UTC Modified: 2006-06-28 02:29 UTC
From: devans14 at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.1.4 OS: Windows XP Pro w/SP2
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: devans14 at gmail dot com
New email:
PHP Version: OS:

 

 [2006-06-28 02:17 UTC] devans14 at gmail dot com
Description:
------------
When trying to find strtotime("last Sunday", $DATE) it will sometimes generate a date on a Saturday instead of a Sunday, but only happens around the 1st week of April of any year (I tested 2006-2010).


Reproduce code:
---------------
<?php
$a=strtotime("20060403");
$b=strtotime("last Sunday", $a);
echo date("Y/m/d", $b);
?>


Expected result:
----------------
2006/04/02



Actual result:
--------------
2006/04/01

A Saturday


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-28 02:29 UTC] devans14 at gmail dot com
Please disregard this bug report.
I actually had PHP 5.0.5 installed and not 5.1.4.
Once I installed 5.1.4 the bug was obviously not present.

Thank you
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 23:01:33 2025 UTC