CelestialCalendar 1.0.0 · unreleased development @ 67a7c4c79a4a4a6aa7e703c9e6f0039ae34bee82
Loading...
Searching...
No Matches
leap_second.hpp File Reference
#include <array>
#include <chrono>
#include <format>
#include <iterator>
#include <algorithm>
#include <stdexcept>
#include "delta_t.hpp"
#include "ymd.hpp"
#include "datetime.hpp"

Classes

struct  astro::leap_second::LeapSecondEntry
 One step of the ΔAT table: from start_utc (inclusive), TAI − UTC is tai_minus_utc seconds. More...

Namespaces

namespace  astro
namespace  astro::leap_second

Functions

constexpr auto astro::leap_second::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 astro::leap_second::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 astro::leap_second::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 astro::leap_second::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 astro::leap_second::TT_MINUS_TAI_SEC
 TT − TAI in seconds. Exact by definition: TT = TAI + 32.184 s.
constexpr std::array< LeapSecondEntry, 28 > astro::leap_second::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 astro::leap_second::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.