(PHP 4, PHP 5)
jdmonthname — Bestimmt den Monat aus dem Julianischen Datum
Diese Funktion bestimmt den Monatsnamen für den in julianday übergebenen Tag im Julianischen Datum. Die Ausgabe erfolgt als String in Abhängigkeit von mode.
Modus | Bedeutung | |
---|---|---|
0 | Gregorianisch (Abk.) | Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec |
1 | Gregorianisch | January, February, March, April, May, June, July, August, September, October, November, December |
2 | Julianisch - (Abk.) | Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec |
3 | Julianisch | January, February, March, April, May, June, July, August, September, October, November, December |
4 | Jüdisch | Tishri, Heshvan, Kislev, Tevet, Shevat, AdarI, AdarII, Nisan, Iyyar, Sivan, Tammuz, Av, Elul |
5 | Französisch revolutionär | Vendemiaire, Brumaire, Frimaire, Nivose, Pluviose, Ventose, Germinal, Floreal, Prairial, Messidor, Thermidor, Fructidor, Extra |
Ein Julianischer Tag als Integer
Der zu verwendende Kalender
Der Monatsname für den gegebenen Julianischen Tag im gewünschten calendar
You can get the month name by passing the month integer value to a simple function....
<?php
function getMonthName($Month){
$strTime=mktime(1,1,1,$Month,1,date("Y"));
return date("F",$strTime);
}
echo getMonthName(10);
?>
Output:
October
YIQV, this should correct your issue with Adar being displayed as AdarI:
<?php
// assuming that $jewish_month is the Jewish month,
// and $jewish_year is the Jewish year,
// you can use this script to replace 'Adar I' with 'Adar' when it is not a leap year.
// this is because a Jewish leap year occurs every 3rd, 6th, 8th, 11th, 14th, 17th, and 19th year.
if( $jewish_month == "AdarI" &&
$jewish_year%19 != 0 &&
$jewish_year%19 != 3 &&
$jewish_year%19 != 6 &&
$jewish_year%19 != 8 &&
$jewish_year%19 != 11 &&
$jewish_year%19 != 14 &&
$jewish_year%19 != 17
) {
$jewish_month = "Adar";
}
?>
I am finding an inconsistency in the Jewish month Adar. The function always returns AdarI regardless of whether the year is a jewish leapyear. The month is known as Adar (not AdarI) in non-leap years. Also when using function jdtojewish with bool hebrew set to true it always returns (ADR) and not (ADR A) when it's a leap year. AdarII in Hebrew and English seems to work properly.