[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [etch][php4]date en français



Salut,

J'ai eu le même problème et ne trouvant de réponse j'ai écris ceci :

<?php

$jour = array(dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi); // change days of week to desired language beginning on Sunday
 $day = $jour[date("w")];

$moise = array(janvier, fevrier, mars, avril, mai, juin, juillet, aout, septembre, octobre, novembre, decembre); // change month to desired language
 $month = $mois[date("n")-1];
$today = $day . " " . date ("j") . " " . $month . " " . date ("Y"); // format time here $tday = $day . " " . date ("j") . " " . $month . " " . date ("Y") . " à " . date ("H:i");
?>

Voilà mais je suis sur qu'il y a un autre moyen ^^

Jeff
----- Original Message ----- From: "Bulot Grégory" <spam_debian.list@batman.dyndns.org>
To: <debian-user-french@lists.debian.org>
Sent: Monday, September 18, 2006 6:26 PM
Subject: [etch][php4]date en français


bonjour,

je regarde depuis un ptit moment sur php.net/fr/manual/ la fonction setlocale, et j'arrive pas à avoir la date en français ! vous faites comment (sans usine
à gaz)


setlocale(LC_ALL, 'french', 'fr', 'fr-FR');
echo "\n<br />> ".strftime("%d %b %Y",strtotime("2006-04-05"));
echo "\n<br />> ".strftime("%A %d %B %Y.");


Resultat chez moi :
05 Apr 2006
Monday 18 September 2006.

au lieu d'avril, Lundi et Septembre !


Merci




Reply to: