Unix Time Conversion

ethioqen.unix_time_conversion.ethiopian_to_unix(e_year, e_month, e_day, eth_hour=12, minute=0, is_pm=False, tz_offset=0)[source]

Convert Ethiopian date/time to Unix timestamp.

Parameters:
  • e_year (int) – Ethiopian year

  • e_month (int) – Ethiopian month (1-13)

  • e_day (int) – Ethiopian day

  • eth_hour (int, optional) – Hour in Ethiopian 12-hour time (1-12). Defaults to 12.

  • minute (int, optional) – Minutes (0-59). Defaults to 0.

  • is_pm (bool, optional) – Whether the time is PM. Defaults to False.

  • tz_offset (int, optional) – Timezone offset in hours. Defaults to 0 (UTC).

Returns:

Unix timestamp (seconds since Unix epoch)

Return type:

int

ethioqen.unix_time_conversion.unix_to_ethiopian(timestamp, tz_offset=0)[source]

Convert Unix timestamp to Ethiopian date/time.

Parameters:
  • timestamp (int) – Unix timestamp (seconds since Unix epoch)

  • tz_offset (int, optional) – Timezone offset in hours. Defaults to 0 (UTC).

Returns:

(year, month, day, hour, minute, is_pm)

hour will be in 12-hour format (1-12) is_pm indicates whether the time is PM

Return type:

tuple