|
CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
|
Classes | |
| struct | LeapSecondEntry |
| One step of the ΔAT table: from start_utc (inclusive), TAI − UTC is tai_minus_utc seconds. More... | |
Functions | |
| constexpr auto | tai_minus_utc (const std::chrono::year_month_day &utc_ymd) -> double |
| Look up ΔAT = TAI − UTC for the given UTC calendar date. | |
| constexpr auto | tt_minus_utc (const std::chrono::year_month_day &utc_ymd) -> double |
| TT − UTC in seconds for the given UTC calendar date: ΔAT + 32.184 s, exact by definition. | |
| constexpr auto | utc_to_tt (const calendar::Datetime &utc_dt) -> calendar::Datetime |
| Convert a calendar::Datetime in UTC to a new calendar::Datetime in TT. | |
| constexpr auto | tt_to_utc (const calendar::Datetime &tt_dt) -> calendar::Datetime |
| Convert a calendar::Datetime in TT to a new calendar::Datetime in UTC. | |
Variables | |
| constexpr double | TT_MINUS_TAI_SEC |
| TT − TAI in seconds. Exact by definition: TT = TAI + 32.184 s. | |
| constexpr std::array< LeapSecondEntry, 28 > | LEAP_SECOND_TABLE |
| The ΔAT (TAI − UTC) step table, from the start of modern UTC (1972-01-01) onwards. Each new entry is one inserted leap second. | |
| constexpr std::chrono::year_month_day | MODERN_UTC_START |
| The first day of modern UTC. Before it this project has no UTC to model: civil datetimes are treated as UT1 and converted through ΔT instead. | |
|
nodiscardconstexpr |
Look up ΔAT = TAI − UTC for the given UTC calendar date.
| utc_ymd | The UTC calendar date. |
| std::invalid_argument | if the date predates modern UTC (1972-01-01). |
|
nodiscardconstexpr |
TT − UTC in seconds for the given UTC calendar date: ΔAT + 32.184 s, exact by definition.
| utc_ymd | The UTC calendar date. |
| std::invalid_argument | if the date predates modern UTC (1972-01-01). |
|
nodiscardconstexpr |
Convert a calendar::Datetime in TT to a new calendar::Datetime in UTC.
| tt_dt | The datetime in TT. |
| std::invalid_argument | If a pre-1972 datetime is invalid or the shift leaves the representable years. |
ΔAT steps on the UTC date, which is only known once the conversion is done — so guess with the TT date, then refine once with the resulting UTC date. One refinement settles any step crossing: consecutive steps are at least half a year apart, while TT − UTC is under two minutes. Before modern UTC (1972-01-01) this falls back to UT1 through ΔT, mirroring utc_to_tt; past the table's last entry ΔAT is held at 37 s (see LEAP_SECOND_TABLE).
|
nodiscardconstexpr |
Convert a calendar::Datetime in UTC to a new calendar::Datetime in TT.
| utc_dt | The datetime in UTC. |
| std::invalid_argument | If a pre-1972 datetime is invalid or the shift leaves the representable years. |
TT = UTC + ΔAT + 32.184 s. Before modern UTC (1972-01-01) the input is treated as UT1 and converted through ΔT instead — the rubber-second UTC of 1960-1971 is not modelled. The seam at 1972-01-01 is ΔT(1972.0) − 42.184 s, well under a second. Past the table's last entry ΔAT is held at 37 s (see LEAP_SECOND_TABLE).
|
inlineconstexpr |
The ΔAT (TAI − UTC) step table, from the start of modern UTC (1972-01-01) onwards. Each new entry is one inserted leap second.
No leap second has been announced since 2017, and CGPM Resolution 4 (2022) decided to discontinue them by 2035 — past the last entry, ΔAT is held at its final value.
|
inlineconstexpr |
The first day of modern UTC. Before it this project has no UTC to model: civil datetimes are treated as UT1 and converted through ΔT instead.
|
inlineconstexpr |
TT − TAI in seconds. Exact by definition: TT = TAI + 32.184 s.