I l@ve RuBoard Previous Section Next Section

jdtofrench

string jdtofrench(int JD) 

Converts a Julian day count to a French Republican Calendar date.

Returns:

French Republican Calendar date; 0/0/0 if an invalid Julian day count is specified

Description:

jdtofrench() converts a Julian day count to a French Republican Calendar date string. The returned date string is formatted as MM/DD/YY.

Valid Julian day counts for this function range from 2375840 to 2380952. If a count outside this range is specified, the function returns 0/0/0.

Version:

3+, 4+

See also:

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

frenchtojd() 

To get a Julian day count from another calendar system, see the various *tojd functions.

Example:

Convert a Gregorian date to a textual French Republican Calendar date
<?php 
function gregorian_to_french ($year, $month, $date) {
    // Define start and end dates for the French Republican Calendar 
    $frc_start = gregoriantojd (9, 22, 1792); 
    $frc_end = gregoriantojd (9, 22, 1806); 

    // Convert date to a Julian day count 
    $date_to_convert = gregoriantojd ($month, $date, $year); 
    // Ensure that the date to be converted is within the start and end dates 
    if ($date_to_convert < $frc_start || $date_to_convert > $frc_end) 
        return FALSE; 

    // Define month names 
    $month_names = array (
        1 => 'Germinal', 2 => 'Flor&eacute;al', 3 => 'Prairial', 
        4 => 'Messidor', 
        5 => 'Thermidor', 6 => 'Fructidor', 7 => 'Vend&eacute;miaire', 
        8 => 'Brumaire', 
        9 => 'Frimaire', 10 => 'Niv&ocirc;se', 11 => 'Pluvi&ocirc;se', 
        12 => 'Vent&ocirc;se', 
        13 => 'Compl&eacute;mentaire / Festival de Sans-culottides' 
    ); 

    $frc_date = jdtofrench ($date_to_convert); 
    list ($month, $date, $year) = explode ('/', $frc_date); 
    return "$month_names[$month] $date, $year"; 
} 
echo gregorian_to_french (1799, 9, 22); 
?> 
    I l@ve RuBoard Previous Section Next Section