Module calendrica-islamic
Islamic calendar conversions and holidays.
Ported from “Calendrical Calculations” (4th edition) by Nachum Dershowitz and Edward M. Reingold. Original Lisp code (CALENDRICA 4.0) is Apache 2.0 licensed.
This module also includes Islamic calendar variants that are not from the book: the TBLA (astronomical/Thursday epoch), Umm al-Qura, and Turkish (Diyanet) calendars. Such additions are marked individually, with their sources, at their definitions.
Info:
- Release: 0.2 2026-09-21
Functions
| islamic_date (year, month, day) | Construct an Islamic date {year, month, day}. |
| fixed_from_islamic (i_date) | Fixed date equivalent to Islamic date i_date. |
| islamic_from_fixed (date) | Islamic date {year, month, day} corresponding to fixed date. |
| fixed_from_islamic_tbla (i_date) | Fixed date equivalent to Islamic TBLA date i_date. |
| islamic_tbla_from_fixed (date) | Islamic TBLA date {year, month, day} corresponding to fixed date. |
| fixed_from_islamic_umalqura (i_date) | Fixed date equivalent to Umm al-Qura Islamic date i_date. |
| islamic_umalqura_from_fixed (date) | Umm al-Qura Islamic date {year, month, day} corresponding to fixed date. |
| fixed_from_diyanet (i_date) | Fixed date equivalent to Turkish (Diyanet) date i_date. |
| diyanet_from_fixed (date) | Turkish (Diyanet) date {year, month, day} corresponding to fixed date. |
| ramadan (g_year) | Fixed dates of Ramadan start (month 9, day 1) in Gregorian year g_year. |
| eid_al_fitr (g_year) | Fixed dates of Eid al-Fitr (month 10, day 1) in Gregorian year g_year. |
| eid_al_adha (g_year) | Fixed dates of Eid al-Adha (month 12, day 10) in Gregorian year g_year. |
| islamic_new_year (g_year) | Fixed dates of Islamic New Year (Muharram 1) occurring in Gregorian year g_year. |
| mawlid (g_year) | Fixed dates of Mawlid an-Nabi occurring in Gregorian year g_year. |
| islamic_in_gregorian (i_month, i_day, g_year) | Fixed dates of Islamic month/day i_month/i_day falling in Gregorian year g_year. |
| islamic_leap_year (i_year) | True if Islamic year i_year is a leap year (355 days). |
Fields
| ISLAMIC_EPOCH | Fixed date of start of the Islamic calendar (July 16, 622 CE Julian). |
| ISLAMIC_EPOCH_TBLA | Fixed date of start of the Islamic TBLA calendar (July 15, 622 CE Julian). |
Functions
- islamic_date (year, month, day)
-
Construct an Islamic date {year, month, day}.
Parameters:
- year number Islamic year.
- month number Islamic month.
- day number Islamic day.
Returns:
-
table
{year, month, day}
- fixed_from_islamic (i_date)
-
Fixed date equivalent to Islamic date
i_date.Parameters:
- i_date table Islamic date {year, month, day}.
Returns:
-
number
Fixed date.
- islamic_from_fixed (date)
-
Islamic date {year, month, day} corresponding to fixed
date.Parameters:
- date number Fixed date.
Returns:
-
table
{year, month, day}
- fixed_from_islamic_tbla (i_date)
-
Fixed date equivalent to Islamic TBLA date
i_date. Identical to the civil calendar but uses the Thursday epoch (one day earlier).Parameters:
- i_date table Islamic date {year, month, day}.
Returns:
-
number
Fixed date.
- islamic_tbla_from_fixed (date)
-
Islamic TBLA date {year, month, day} corresponding to fixed
date.Parameters:
- date number Fixed date.
Returns:
-
table
{year, month, day}
- fixed_from_islamic_umalqura (i_date)
-
Fixed date equivalent to Umm al-Qura Islamic date
i_date. The Umm al-Qura calendar is only defined over its published table (AH 1300–1600); a year outside that range raises an error. For a computed estimate beyond the table, use the astronomical Saudi calendar (saudi_islamic) in calendrica-astronomical-lunar.Parameters:
- i_date table Islamic date {year, month, day}.
Returns:
-
number
Fixed date.
Raises:
If the year is outside AH 1300–1600. - islamic_umalqura_from_fixed (date)
-
Umm al-Qura Islamic date {year, month, day} corresponding to fixed
date. The Umm al-Qura calendar is only defined over its published table (AH 1300–1600); a date outside that range raises an error. For a computed estimate beyond the table, use the astronomical Saudi calendar (saudi_islamic) in calendrica-astronomical-lunar.Parameters:
- date number Fixed date.
Returns:
-
table
{year, month, day}
Raises:
Ifdateis outside the tabulated range (AH 1300–1600). - fixed_from_diyanet (i_date)
-
Fixed date equivalent to Turkish (Diyanet) date
i_date. Defined only over the tabulated range; a date outside it raises an error.Parameters:
- i_date table Islamic date {year, month, day}.
Returns:
-
number
Fixed date.
Raises:
If the date is outside the tabulated range. - diyanet_from_fixed (date)
-
Turkish (Diyanet) date {year, month, day} corresponding to fixed
date. Defined only over the tabulated range; a date outside it raises an error.Parameters:
- date number Fixed date.
Returns:
-
table
{year, month, day}
Raises:
Ifdateis outside the tabulated range. - ramadan (g_year)
-
Fixed dates of Ramadan start (month 9, day 1) in Gregorian year
g_year.Parameters:
- g_year number Gregorian year.
Returns:
-
{number,...}
Fixed dates.
- eid_al_fitr (g_year)
-
Fixed dates of Eid al-Fitr (month 10, day 1) in Gregorian year
g_year.Parameters:
- g_year number Gregorian year.
Returns:
-
{number,...}
Fixed dates.
- eid_al_adha (g_year)
-
Fixed dates of Eid al-Adha (month 12, day 10) in Gregorian year
g_year.Parameters:
- g_year number Gregorian year.
Returns:
-
{number,...}
Fixed dates.
- islamic_new_year (g_year)
-
Fixed dates of Islamic New Year (Muharram 1) occurring in Gregorian year
g_year.Parameters:
- g_year number Gregorian year.
Returns:
-
{number,...}
Fixed dates.
- mawlid (g_year)
-
Fixed dates of Mawlid an-Nabi occurring in Gregorian year
g_year.Parameters:
- g_year number Gregorian year.
Returns:
-
table
List of fixed dates.
- islamic_in_gregorian (i_month, i_day, g_year)
-
Fixed dates of Islamic month/day
i_month/i_dayfalling in Gregorian yearg_year.Parameters:
- i_month number Islamic month.
- i_day number Islamic day.
- g_year number Gregorian year.
Returns:
-
{number,...}
Fixed dates.
- islamic_leap_year (i_year)
-
True if Islamic year
i_yearis a leap year (355 days).Parameters:
- i_year number Islamic year.
Returns:
-
boolean