I l@ve RuBoard Previous Section Next Section

frenchtojd

int frenchtojd(int month, int day, int year) 

month

French Republican Calendar month number

day

French Republican Calendar day of month

year

French Republican Calendar year

Converts a French Republican Calendar date to Julian day count.

Returns:

Julian day count; 0 if any parameter falls outside the valid range

Description:

frenchtojd() converts a French Republican Calendar date to a Julian day count. If any of the function arguments falls outside the acceptable range, the function returns 0.

The following table shows the acceptable ranges for the parameters of this function.

Parameter

Acceptable Range of Values

month

1 to 13

day

1 to 30

year

1 to 14

Note:

The French Republican Calendar was developed around the time of the French Revolution to provide a rational and secular alternative to the Gregorian calendar. The attempt was beautiful, rendering a calendar that was sensible, lyrical, and, for the time, humanist. The calendar's epoch (start) was calculated from the day that the Republic was proclaimed (September 22, 1792). The calendar was not put into use until November 24, 1793, and only remained in use until the end of 1805. Additional resources on this interesting calendar (and time in French history) can be found on the Internet—a simple search for French Republican Calendar should bring up an abundance of reference material. Alternatively, check your local library for resources.


Version:

3+, 4+

See also:

To convert a Julian day count to a French Republican Calendar date:

jdtofrench() 

To convert a Julian day count to another calendar system, see the other jdto* functions.

Examples:

Convert a French Republican Calendar date to a Gregorian date
$frc_date = frenchtojd (10, 5, 9); 
echo jdtogregorian ($frc_date); 
Convert a French Republican Calendar month name or numeral to its numeric equivalent
/* 
    Here is a little bonus script that converts FRC month names and Roman 
    numerals to their numeric equivalents. Enjoy! 
*/ 
function frc_month_convert ($month) {
    $months = array (
        // The months of Spring 
        'I' => 'germinal', 'II' => 'flor.{1,8}al', 'III' => 'prairial', 
        // The months of Summer 
        'IV' => 'messidor', 'V' => 'thermidor', 'VI' => 'fructidor', 
        // The months of Autumn 
        'VII' => 'vend.{1,8}miaire', 'VIII' => 'brumaire', 'IX' => 'frimaire', 
        // The months of Winter 
        /* 
        Note the regular expression syntax within the month names 
        They allow the function to accommodate a wide variety of 
        escape sequences 
        (Such as HTML/XML/SGML and even simple TEX) 
        */ 
        'X' => 'niv.{1,8}se', 'XI' => 'pluvi.{1,8}se', 'XII' => 
        'venti.{1,8}se', 
        // Complementary or feast days at the end of the year 
        'XIII' => '(compl.{1,8}mentaire|sans.culottides' 
    ); 
    // Clear out any nasty whitespace 
    $month = trim ($month); 
    for ($month_no = 1; list ($numeral, $name) = each ($months); ++$month_no) 
        if (strtoupper ($month) == $numeral || preg_match ("/$name/i", 
        $month)) 
            return $month_no; 
} 

echo frc_month_convert ('X') . '<br />'; 
echo frc_month_convert ('Vendimiaire') . '<br />'; 
echo frc_month_convert ('Pluviôse ') . '<br />'; 
    I l@ve RuBoard Previous Section Next Section