php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48341 strtotime("+1 xxx") does not work correctly
Submitted: 2009-05-20 03:12 UTC Modified: 2009-05-20 08:20 UTC
From: aminm at fastmail dot fm Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 5.2.9 OS: Win32
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: aminm at fastmail dot fm
New email:
PHP Version: OS:

 

 [2009-05-20 03:12 UTC] aminm at fastmail dot fm
Description:
------------
$datetime1 = strtotime("June 06, 2009 10:00 AM");
$datetime2 = strtotime("+1 Saturday 10:00 AM", $datetime1);
$datetime1 and $datetime2 should be one week apart but they are equal

strtotime("next Saturday 10:00 AM", $datetime1) will work correctly however.
     



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-20 08:20 UTC] jani@php.net
As a human, how would you interpret such string? I wouldn't know you want it to be one WEEK ahead, I though you wanted one DAY ahead.. :)

So it's quite unfixable.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 19:01:32 2024 UTC