Re: Strtotime returns 02/09/2008 for "next Saturday"....
- From: nrixham@xxxxxxxxx (Nathan Rixham)
- Date: Thu, 31 Jan 2008 16:26:20 +0000
Mike Morton wrote:
I have been using:from the manual page on php.net for strtotime
$nextSaturday= date("m/d/Y",strtotime("next saturday"));
For months long time now with out problems, but in the last two days, it
went kind of funky. It is now returning:
02/09/2008 instead of the expected 02/02/2008. I have tried the same code
on another server and different version of PHP,and it works ok.
More info:
Shell date: Thu Jan 31 09:44:50 EST 2008
echo date("Y-m-d g:i A T", time()); = 2008-01-31 10:00 AM EST
echo date("Y-m-d g:i A T", strtotime("next saturday")); = 2008-02-09 12:00
AM EST
version: 4.3.9 (highest version we can have at the moment)
I could not find this in the known bugs from this version....
So - is this something that is server or version specific?
TIA!
Warning
In PHP versions prior to 4.4.0, "next" is incorrectly computed as +2. A typical solution to this is to use "+1".
.
- References:
- Strtotime returns 02/09/2008 for "next Saturday"....
- From: Mike Morton
- Strtotime returns 02/09/2008 for "next Saturday"....
- Prev by Date: Re: determine number of entries Options (2)
- Next by Date: Re: [PHP] Strtotime returns 02/09/2008 for "next Saturday"....
- Previous by thread: Re: [PHP] Strtotime returns 02/09/2008 for "next Saturday"....
- Next by thread: Re: [PHP] Strtotime returns 02/09/2008 for "next Saturday"....
- Index(es):
Relevant Pages
|