Calendar Conversion

ethioqen.calendar_conversion.convert_ethiopian_to_gregorian(eth_year: int, eth_month: int, eth_day: int) → tuple[int, int, int][source]

Convert an Ethiopian date to Gregorian.

Parameters:
  • eth_year – Ethiopian year (>= 1).

  • eth_month – Ethiopian month (1-13).

  • eth_day – Ethiopian day (1-30; 1-5/6 for Pagume).

Returns:

Tuple (year, month, day) of the equivalent Gregorian date.

Raises:

InvalidDateException – If the Ethiopian date is invalid.

Example

>>> convert_ethiopian_to_gregorian(2016, 1, 1)
(2023, 9, 12)
ethioqen.calendar_conversion.convert_gregorian_to_ethiopian(greg_year: int, greg_month: int, greg_day: int) → tuple[int, int, int][source]

Convert a Gregorian date to Ethiopian.

Parameters:
  • greg_year – Gregorian year (>= 1).

  • greg_month – Gregorian month (1-12).

  • greg_day – Gregorian day (1-28/29/30/31 depending on month).

Returns:

Tuple (year, month, day) of the equivalent Ethiopian date.

Raises:

InvalidDateException – If the Gregorian date is invalid (e.g. 2023-02-29 or 2023-04-31).

Example

>>> convert_gregorian_to_ethiopian(2023, 9, 12)
(2016, 1, 1)
ethioqen.calendar_conversion.is_ethiopian_leap_year(year: int) → bool[source]

Determine if the given Ethiopian year is a leap year.

ethioqen.calendar_conversion.is_gregorian_leap_year(year: int) → bool[source]

Determine if the given Gregorian year is a leap year.