Module calendrica-modern-civil

Modern civil calendars not covered by “Calendrical Calculations”.

This module collects widely used civil calendars that are not part of Dershowitz & Reingold’s Calendrical Calculations (and therefore not ported from CALENDRICA 4.0). Each calendar’s algorithm and source (with reference links) is documented with the relevant conversion functions below. All are built on the book’s Gregorian or Julian routines.

Calendars provided:

For ICU/CLDR calendar equivalences see the ICU calendar guide: https://unicode-org.github.io/icu/userguide/datetime/calendar/.

Info:

  • Release: 0.2 2026-09-21

Functions

fixed_from_indian_national (i_date) Fixed date equivalent to the Indian National (reformed Śaka) date i_date.
indian_national_from_fixed (date) Indian National (reformed Śaka) date {year, month, day} for fixed date.
fixed_from_roc (r_date) Fixed date equivalent to the Minguo (ROC) date r_date.
roc_from_fixed (date) Minguo (ROC) date {year, month, day} corresponding to fixed date.
fixed_from_thai_solar (t_date) Fixed date equivalent to the Thai solar (Buddhist Era) date t_date.
thai_solar_from_fixed (date) Thai solar (Buddhist Era) date {year, month, day} corresponding to fixed date.
fixed_from_bengali_revised (b_date) Fixed date equivalent to the revised Bengali date b_date.
bengali_revised_from_fixed (date) Revised Bengali date {year, month, day} corresponding to fixed date.
fixed_from_nanakshahi (n_date) Fixed date equivalent to the Nanakshahi date n_date.
nanakshahi_from_fixed (date) Nanakshahi date {year, month, day} corresponding to fixed date.
fixed_from_amazigh (a_date) Fixed date equivalent to the Amazigh (Berber) date a_date.
amazigh_from_fixed (date) Amazigh (Berber) date {year, month, day} corresponding to fixed date.
fixed_from_japanese_era (j_date) Fixed date equivalent to the Japanese era date j_date.
japanese_era_from_fixed (date) Japanese era date {era, year, month, day} corresponding to fixed date.
japanese_era_name (era_id) Display name for Japanese era identifier era_id, or nil if unknown.

Fields

japanese_eras Ordered list of modern gengō eras.


Functions

fixed_from_indian_national (i_date)
Fixed date equivalent to the Indian National (reformed Śaka) date i_date.

Parameters:

  • i_date table Indian National date {year, month, day}.

Returns:

    number Fixed date.
indian_national_from_fixed (date)
Indian National (reformed Śaka) date {year, month, day} for fixed date.

Parameters:

  • date number Fixed date.

Returns:

    table {year, month, day}
fixed_from_roc (r_date)
Fixed date equivalent to the Minguo (ROC) date r_date.

Parameters:

  • r_date table Minguo date {year, month, day}.

Returns:

    number Fixed date.
roc_from_fixed (date)
Minguo (ROC) date {year, month, day} corresponding to fixed date.

Parameters:

  • date number Fixed date.

Returns:

    table {year, month, day}
fixed_from_thai_solar (t_date)
Fixed date equivalent to the Thai solar (Buddhist Era) date t_date.

Parameters:

  • t_date table Thai solar date {year, month, day}.

Returns:

    number Fixed date.
thai_solar_from_fixed (date)
Thai solar (Buddhist Era) date {year, month, day} corresponding to fixed date.

Parameters:

  • date number Fixed date.

Returns:

    table {year, month, day}
fixed_from_bengali_revised (b_date)
Fixed date equivalent to the revised Bengali date b_date.

Parameters:

  • b_date table Revised Bengali date {year, month, day}.

Returns:

    number Fixed date.
bengali_revised_from_fixed (date)
Revised Bengali date {year, month, day} corresponding to fixed date.

Parameters:

  • date number Fixed date.

Returns:

    table {year, month, day}
fixed_from_nanakshahi (n_date)
Fixed date equivalent to the Nanakshahi date n_date.

Parameters:

  • n_date table Nanakshahi date {year, month, day}.

Returns:

    number Fixed date.
nanakshahi_from_fixed (date)
Nanakshahi date {year, month, day} corresponding to fixed date.

Parameters:

  • date number Fixed date.

Returns:

    table {year, month, day}
fixed_from_amazigh (a_date)
Fixed date equivalent to the Amazigh (Berber) date a_date.

Parameters:

  • a_date table Amazigh date {year, month, day}.

Returns:

    number Fixed date.
amazigh_from_fixed (date)
Amazigh (Berber) date {year, month, day} corresponding to fixed date.

Parameters:

  • date number Fixed date.

Returns:

    table {year, month, day}
fixed_from_japanese_era (j_date)
Fixed date equivalent to the Japanese era date j_date. j_date is {era, year, month, day}, where era is a gengō era id ("meiji", "taisho", "showa", "heisei", "reiwa") or an inherited Gregorian era ("ce", "bce"), year is the year within the era (the first year is 1), and month/day are Gregorian.

Parameters:

  • j_date table Japanese era date {era, year, month, day}.

Returns:

    number Fixed date.

Raises:

If the era identifier is unknown.
japanese_era_from_fixed (date)
Japanese era date {era, year, month, day} corresponding to fixed date. Dates before the Meiji era use the inherited Gregorian eras "ce"/"bce".

Parameters:

  • date number Fixed date.

Returns:

    table {era, year, month, day}
japanese_era_name (era_id)
Display name for Japanese era identifier era_id, or nil if unknown. Covers the gengō eras plus the inherited "ce" and "bce".

Parameters:

  • era_id string Era identifier.

Returns:

    string or nil Display name, e.g. "Reiwa", "CE".

Fields

japanese_eras
Ordered list of modern gengō eras. Each entry is {id, name, start_year, start_fixed}.
generated by LDoc 1.5.0 Last updated 2026-10-01 02:01:33