function date_fr($timestamp, $mode) {
$result = "";
$dval = date("w",$timestamp) - 1;
$nval = (int) date("d",$timestamp);
$mval = date("m",$timestamp) - 1;
// Feel free to personalize arrays for your mothertongue :-)
$day = array("lundi","mardi","mercredi","jeudi",
"vendredi","samedi","dimanche");
$sday = array("lun","mar","mer","jeu","ven","sam","dim");
$month = array("janvier","février","mars","avril",
"mai","juin","juillet","août","septembre",
"octobre","novembre","décembre");
$smonth = array("jan","fév","mars",
"avr","mai","juin","juil","août",
"sept","oct","nov","déc");
// outputs the date with caps or not, long or short
switch ($mode) {
case "Long":
$result = ucfirst($day[$dval])." $nval ".ucfirst($month[$mval]);
break; // Mardi 30 Juin
case "long":
$result = "$day[$dval] $nval $month[$mval]";
break; // mardi 30 juin
case "Short":
$result = ucfirst($sday[$dval])." $nval ".ucfirst($smonth[$mval]);
break; // Mar 30 Juin
default:
$result = "$sday[$dval] $nval $smonth[$mval]";
// mar 30 juin
}
return $result;
}
// to print the modification date of the current page
// echo date_fr(filemtime(basename($PHP_SELF)),"");
?>