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
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: 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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 01:01:33 2024 UTC