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

Pull Requests

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: Sat Sep 28 01:01:27 2024 UTC