downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

JDToGregorian> <JDMonthName
Last updated: Fri, 14 Aug 2009

view this page in

JDToFrench

(PHP 4, PHP 5)

JDToFrenchConvertit le nombre de jours du calendrier Julien en date du calendrier français républicain

Description

string jdtofrench ( int $juliandaycount )

Convertit le nombre de jours du calendrier julien en date du calendrier français républicain.

Liste de paramètres

julianday

Le numéro du jour Julien, sous la forme d'un entier

Valeurs de retour

La date française républicaine, sous la forme d'une chaîne de caractères "mois/jour/année".

Voir aussi

  • frenchtojd() - Convertit une date du calendrier français républicain en nombre de jours du calendrier Julien
  • cal_from_jd() - Convertit le nombre de jours Julien en un calendrier spécifique



add a note add a note User Contributed Notes
JDToFrench
squenz at titania dot bottoms-dream dot de
06-Apr-2006 03:25
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] ;

/* the output will be:
    18 Brumaire VIII

*/

function gregorian2FrenchDateArray($m, $d, $y)
{

   
$julian_date = gregoriantojd($m, $d, $y);
   
$french = jdtofrench($julian_date);
    if(
$french == "0/0/0")
        return
"" ;

   
$arD = split("/", $french) ;
   
   
// get the month name
   
$monthname = FrenchMonthNames($arD[0]) ;
   
   
/* convert the year number to roman digits (as most historians do and documents of the time did */
   
$stryear = decrom($arD[2]) ;
    return array(
$monthname, $arD[1], $stryear ) ;
}

function
FrenchMonthNames($mo)
{
   
/* The names have been invented by Fabre d'Églantine, a second or rather third rank poet
of primarily pastoral poems, with each name referring to the respective period in the agricultural year; e.g. "Vendémiaire" (approx. September) is derived from "vendange" ("harvest"), "Brumaire" (Ocotober/November) from "brume" ("fog") and so on ...     */
   
   
   
$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;
}
?>
serged at noos dot fr
28-Oct-2003 05:00
Very limited function:

(extract from source of 4.3.3)
These routines only convert dates in years 1 through 14 (Gregorian dates 22 September 1792 through 22 September 1806).  This more than  covers the period when the calendar was in use.
 
Pour les français :
Ces routines ne converitssent les dates que de l'an 1 à 14 (du 22 septembre 1792 au 22 septembre 1806). Cela couvre plus que la période pendant laquelle le calendrier à été utilisé.

JDToGregorian> <JDMonthName
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites