PHP.mk документација

jdtofrench

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

function.jdtofrench.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека function.jdtofrench.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
jdtofrench

Референца за `function.jdtofrench.php` со подобрена типографија и навигација.

function.jdtofrench.php

jdtofrench

(PHP 4, PHP 5, PHP 7, PHP 8)

jdtofrenchConverts a Julian Day Count to the French Republican Calendar

= NULL

jdtofrench(int $julian_day): string

Конвертира Јулијанскиот ден во Францускиот републикански календар

Параметри

julian_day

Јулијански број на ден како цел број

Вратени вредности

Конвертира Јулијанскиот ден во Францускиот републикански календар.

Види Исто така

  • frenchtojd() Датумот на Француската револуција како стринг во формат "месец/ден/година"
  • cal_from_jd() - Конвертира од Јулијански ден во поддржан календар

Белешки од корисници 4 белешки

- Конвертира датум од Францускиот републикански календар во Јулијанскиот ден
пред 16 години
If you want to convert a date later than September 22nd 1806, you could use this function. It's a bit crude and due to the fact the original function terminates in the middle of 1806, it uses 1805 as it's 'terminus post quem'.
<?php
function extended_jdtofrench ($juliandate) {
    if ($juliandate > 2380945) {
        // jdtofrench () only accepts dates until september 1806
        $gregorian_date = jdtogregorian ($juliandate);
        $temp = explode ('/', $gregorian_date);
        $year = $temp[2];
        $juliandate = gregoriantojd ($temp[0], $temp[1], 1805);
        $republican_date = jdtofrench ($juliandate);
        $republican_date = explode ('/', $republican_date);
        $diff = $year - 1805;
        $republican_date[2] = $republican_date[2] + $diff;
    } else {
        $republican_date = jdtofrench ($juliandate);
    }
    return $republican_date;
}
?>
pieterc dot depraetere at ugent dot be
19 години пред
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;
}
?>
popy-dev
пред 8 години
Also note that there are few date converters handling French calendar outside the jdtofrench covered range.
squenz at titania dot bottoms-dream dot de
пред 22 години
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?.
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.