cs_benedict
Messages postés187Date d'inscriptionmercredi 25 septembre 2002StatutMembreDernière intervention 7 mai 2009
-
11 mai 2008 à 11:27
cs_benedict
Messages postés187Date d'inscriptionmercredi 25 septembre 2002StatutMembreDernière intervention 7 mai 2009
-
13 mai 2008 à 06:42
Avec le code suivant, j'obtiens le numéro du mois sous le format "01 janvier 2008."
$dateDepart=strftime ('%d %B %Y',$depart);
Comment faire pour obtenir "1 janvier 2008"
Merci de votre aide.
yoman64
Messages postés962Date d'inscriptionsamedi 19 janvier 2002StatutMembreDernière intervention 2 août 20102 11 mai 2008 à 22:48
Hello.
Evangun -> Si tu es sous windows ou sur un système obscure quelconque, alors la doc (si si, tu trouves tout ça sur php.net ) nous dit que:
Not all conversion specifiers may be supported by your C library, in which
case they will not be supported by PHP's strftime().
Additionally, not all platforms support negative timestamps, therefore your
date range may be limited to no earlier than the Unix epoch. This means that
e.g. %e, %T, %R and %D (there might be more) and dates prior to
Jan 1, 1970 will not work on Windows, some Linux
distributions, and a few other operating systems. For Windows systems a
complete overview of supported conversion specifiers can be found at this
»MSDN website.
Sinon une solution "malpropre" serait de faire if (strncmp($dateDepart=strftime ('%d %B %Y',$depart),'0',1) === 0) $dateDepart = substr($dateDepart,1);
Ça c'est si tu tiens à utiliser strftime pour une raison spécifique, sinon date() te donnerais moin de mal, non ?
-------------------
Vous cherchez un hebergement Php/MySQL Gratuit et sans publicités ??
Et bien c'est la : www.e3b.org
cs_benedict
Messages postés187Date d'inscriptionmercredi 25 septembre 2002StatutMembreDernière intervention 7 mai 20092 13 mai 2008 à 06:42
C'est effectivement simple.
Mais il faut alors traduire la date puisqu'elle est en anglais..
Comment passes tu d'une date en anglais à une date en français ?
Benedict