PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Strtotime returns 02/09/2008 for "next Saturday"....
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Strtotime returns 02/09/2008 for "next Saturday"....

Réponse
 
LinkBack Outils de la discussion
Vieux 31/01/2008, 15h02   #1
Mike Morton
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Strtotime returns 02/09/2008 for "next Saturday"....

I have been using:

$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!

--
Cheers

Mike Morton

************************************************** **
*
* Tel: 905-465-1263
* Email: mike@webtraxx.com
*
************************************************** **
  Réponse avec citation
Vieux 31/01/2008, 16h04   #2
Tom Chubb
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Strtotime returns 02/09/2008 for "next Saturday"....

On 31/01/2008, Mike Morton <mike@webtraxx.com> wrote:
>
> I have been using:
>
> $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!
>
> --
> Cheers
>
> Mike Morton
>
> ************************************************** **
> *
> * Tel: 905-465-1263
> * Email: mike@webtraxx.com
> *
> ************************************************** **
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

The manual says: *Warning*

In PHP versions prior to 4.4.0, *"next"* is incorrectly computed as +2. A
typical solution to this is to use *"+1"*.

Dunno if that s you out? Is the other server > 4.4.0?
http://uk3.php.net/strtotime

  Réponse avec citation
Vieux 31/01/2008, 16h26   #3
Nathan Rixham
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Strtotime returns 02/09/2008 for "next Saturday"....

Mike Morton wrote:
> I have been using:
>
> $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!
>

from the manual page on php.net for strtotime

Warning

In PHP versions prior to 4.4.0, "next" is incorrectly computed as +2. A
typical solution to this is to use "+1".
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 23h55.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,12617 seconds with 11 queries