chrarus2004 Posted March 12, 2005 Share Posted March 12, 2005 voila les gas je veux afficher sur mon site une date au format français exple :( nous sommes le 12 mars 2005 Link to comment Share on other sites More sharing options...
Country Posted March 12, 2005 Share Posted March 12, 2005 Voici un bout de code qui te permet de faire cela. $mois=array("janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"); echo 'nous sommes le ',date("j"),' ',$mois[date("n")-1],' ',date("Y"); http://fr2.php.net/date pour plus d'infos Link to comment Share on other sites More sharing options...
Sarvok Posted March 12, 2005 Share Posted March 12, 2005 Faut absolument que j'me la raconte, j'viens de me mettre à php et je viens de faire la fonction dans l''aprem' A mettre dans le <head> <? $now = getdate(); $jour_sem = array("Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi"); $mois=array(0, "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"); $date_format=$jour_sem[$now[wday]]." ".$now[mday]." ".$mois[$now[mon]]." ".$now[year]; ?> A mettre à l'endroit ou tu veux que la date apparaisse (donc dans le <body> <? echo $date_format; ?> PS - Script licensié GNU GPL Link to comment Share on other sites More sharing options...
savory Posted March 14, 2005 Share Posted March 14, 2005 Lol comment c'est trop crade essaye plutot ca <? setlocale (LC_ALL, 'fr_FR'); setlocale(LC_TIME, "fr"); echo strftime("Nous sommes le %A %d %B %Y"); ?> http://fr2.php.net/strftime Link to comment Share on other sites More sharing options...
theocrite Posted March 21, 2005 Share Posted March 21, 2005 Bien vu savory (Je crois que j'ai donné l'autre solution il n'y a pas très longtemps, mais je ne me souvient plus à qui ) EDIT : ah non ça va c'était pour autre chose : http://www.pcinpact.com/forum/index.php?sh...=0entry860396 Merci quand même pour la réponse ça me servira Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.