Here is a small piece of code to obtain the string data for a correctly converted gregorian date:
<?php
$arDateFrench = gregorian2FrenchDateArray(11, 9, 1799) ;
echo $arDateFrench[1] . " " . $arDateFrench[0] . " " . $arDateFrench[2] ;
function gregorian2FrenchDateArray($m, $d, $y)
{
$julian_date = gregoriantojd($m, $d, $y);
$french = jdtofrench($julian_date);
if($french == "0/0/0")
return "" ;
$arD = split("/", $french) ;
$monthname = FrenchMonthNames($arD[0]) ;
$stryear = decrom($arD[2]) ;
return array($monthname, $arD[1], $stryear ) ;
}
function FrenchMonthNames($mo)
{
$arMo = array("Vendémiaire",
"Brumaire",
"Frimaire",
"Niv?se",
"Pluvi?se",
"Vent?se",
"Germinal",
"Floréal",
"Prairial",
"Messidor",
"Thermidor",
"Fructidor",
"Sansculottide") ;
if($mo < count($arMo)+1)
return $arMo[$mo-1] ;
}
function decrom($dec){
$digits=array(
1 => "I",
4 => "IV",
5 => "V",
9 => "IX",
10 => "X",
40 => "XL",
50 => "L",
90 => "XC",
100 => "C",
400 => "CD",
500 => "D",
900 => "CM",
1000 => "M"
);
krsort($digits);
$retval="";
foreach($digits as $key => $value){
while($dec>=$key){
$dec-=$key;
$retval.=$value;
}
}
return $retval;
}
?>