php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21984 in 4.3.0 strtotime says next monday is Feb 10th 2003, thats wrong (4.2.3 works)
Submitted: 2003-01-31 08:39 UTC Modified: 2003-06-10 19:27 UTC
Votes:3
Avg. Score:4.3 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: krueger at bundes-verlag dot de Assigned:
Status: Closed Package: Date/time related
PHP Version: 4.3.0 OS: SuSE Linux 8.1
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: krueger at bundes-verlag dot de
New email:
PHP Version: OS:

 

 [2003-01-31 08:39 UTC] krueger at bundes-verlag dot de
Today is Friday, 31st Jan. 

On our server with the new PHP 4.3.0, strtotime says "next monday" is "Feb 10th 2003". That is wrong!

On our older servers, which have still PHP 4.2.3, the very same script says "Feb 3rd 2003", which is correct.

In 4.3.0 you fixed a bug  with "calculation of number of week" - maybe that's the problem.

Server clocks are syncronized between the servers, so that's not the point :-)

Thanks and bye,
Rolf

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-31 10:58 UTC] pollita@php.net
Confirmed with HEAD on Linux.
 [2003-01-31 11:22 UTC] krueger at bundes-verlag dot de
Can I do something against that or do I have to wait for 4.3.1?

Regards,
Rolf
 [2003-01-31 11:34 UTC] krueger at bundes-verlag dot de
Just some into: I have "downgraded" the server to 4.2.3 - now it works fine...
 [2003-02-03 05:36 UTC] m dot ford at lmu dot ac dot uk
H'rumph!  Actually, both of your servers are producing the answer they should!

In PHP versions prior to 4.3.0, the handling of "next" in strtotime() was incorrect; it was fixed for 4.3.0, so your script will require a minor update.  Please see bug http://bugs.php.net/bug.php?id=18655 for the relevent discussion.

This bug should be set to Bogus -- I don't think I have karma yet, so would somebody do it, please?

Cheers!

Mike
 [2003-02-03 05:44 UTC] krueger at bundes-verlag dot de
Well, but it isn't correct now, but was before... or is there a new term with with a can determine the "coming Monday" with strtotime?
 [2003-02-03 08:00 UTC] m dot ford at lmu dot ac dot uk
It *is* correct now, because that's how it always should have worked.  I agree that it's less intuitive, but that doesn't make it any less correct.  (Blame the people who defined the GNU date format!)

"Monday", or "first Monday", or "1 Monday" will give you the first Monday which is zero or more days after the specified date (or today).

"next Monday" or "2 Monday" will give you the Monday after that.

"third Monday" or "3 Monday" will give you the one after that.

And so on (except that the text versions run out at "twelfth", so from there onward you can only use "13 Monday", "14 Monday", etc.).

Cheers!

Mike
 [2003-02-03 08:17 UTC] moriyoshi@php.net
Then, how about "second monday"?
 [2003-02-03 10:22 UTC] m dot ford at lmu dot ac dot uk
Well, yeah, you'd think wouldn't you? -- but the sequence is explicitly "first, next, third, ...".

Perhaps you want to turn this into a Feature Request?

Mike
 [2003-06-10 19:27 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

Appears to work correctly in latest CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC