1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| function date_fran($timestamp)
{ global $dateDujour;
$mois = array("Janvier", "Fevrier", "Mars",
"Avril","Mai", "Juin",
"Juillet", "Août","Septembre",
"Octobre", "Novembre", "Decembre");
$jours= array("Dimanche", "Lundi", "Mardi",
"Mercredi", "Jeudi", "Vendredi",
"Samedi");
return $jours[date("w",$timestamp)]." ".date("j",$timestamp).(date("j",$timestamp)==1 ? "er":" ").
$mois[date("n",$timestamp)-1]." ".date("Y",$timestamp);
}
$timestamp = time();
if (date("H",$timestamp) >= 0 && date("H",$timestamp) < 5) {
$dateDuJour= date_fran(strtotime('-1 day',$timestamp));
}
else {
$dateDuJour= date_fran($timestamp);
}
echo $dateDuJour; |
Partager