php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24941 strtotime returns same date for "first wednesday" and "second Wednesday"
Submitted: 2003-08-04 17:29 UTC Modified: 2003-08-04 20:32 UTC
From: jpage at javeo dot com Assigned:
Status: Not a bug Package: Date/time related
PHP Version: 4.3.1 OS: Red Hat Linux
Private report: No CVE-ID: None
 [2003-08-04 17:29 UTC] jpage at javeo dot com
Description:
------------
strtotime() returns the same result for "first wednesday" and "second wednesday".  I ran this against 'today' - Aug 4 2003, but the code below should show the error on any day.


Reproduce code:
---------------
$t=strtotime("Aug 3 2003"); 

$r=strtotime("first wednesday",$t);
print(date('r',$r));

print("<br>");

$r=strtotime("second wednesday",$t);
print(date('r',$r));


Expected result:
----------------
two different dates a week apart

Actual result:
--------------
Wed Aug for both

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-04 17:31 UTC] jpage at javeo dot com
Typo:
Actual result: both produce Aug 6 2003
 [2003-08-04 19:30 UTC] iliaa@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

Same bug as 2 other strtotime() bugs, which are currently opened.
 [2003-08-04 20:25 UTC] jpage at javeo dot com
Well I tried to search for similar bugs but did not find any that struck me as the same.  You say there are two but fail to mention which ones they are.  Can you help me out here?
 [2003-08-04 20:32 UTC] iliaa@php.net
Bug #20382 and #18670
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 13:01:36 2024 UTC