pub struct TAI(/* private fields */);Expand description
International Atomic Time representation.
Wraps a JulianDate to provide TAI-specific semantics. TAI serves as the
hub for conversions between other time scales (UTC, TT, GPS, TDB, etc.).
Implementations§
Source§impl TAI
impl TAI
Sourcepub fn new(seconds: i64, nanos: u32) -> TAI
pub fn new(seconds: i64, nanos: u32) -> TAI
Creates TAI from Unix timestamp components.
Converts seconds since 1970-01-01 00:00:00 plus nanoseconds to TAI. Note: This assumes the input is already in TAI, not UTC.
Sourcepub fn from_julian_date(jd: JulianDate) -> TAI
pub fn from_julian_date(jd: JulianDate) -> TAI
Creates TAI from a JulianDate.
Sourcepub fn from_julian_date_raw(jd1: f64, jd2: f64) -> TAI
pub fn from_julian_date_raw(jd1: f64, jd2: f64) -> TAI
Creates TAI from raw Julian Date components.
Useful when you already have the split JD representation and want to avoid the overhead of creating a JulianDate first.
Sourcepub fn j2000() -> TAI
pub fn j2000() -> TAI
Returns TAI at the J2000.0 epoch (2000-01-01 12:00:00 TT).
JD = 2451545.0
Sourcepub fn to_julian_date(&self) -> JulianDate
pub fn to_julian_date(&self) -> JulianDate
Returns the underlying Julian Date.
Sourcepub fn add_seconds(&self, seconds: f64) -> TAI
pub fn add_seconds(&self, seconds: f64) -> TAI
Returns a new TAI offset by the given number of seconds.
Trait Implementations§
Source§impl From<JulianDate> for TAI
impl From<JulianDate> for TAI
Source§fn from(jd: JulianDate) -> TAI
fn from(jd: JulianDate) -> TAI
Source§impl FromStr for TAI
impl FromStr for TAI
Source§impl ToTCG for TAI
Convert TAI to TCG by chaining through TT.
impl ToTCG for TAI
Convert TAI to TCG by chaining through TT.
TAI has no direct conversion to TCG. This chains: TAI → TT → TCG.
Source§impl ToTT for TAI
Convert TAI to TT by adding the fixed 32.184 second offset.
impl ToTT for TAI
Convert TAI to TT by adding the fixed 32.184 second offset.
The offset is added to whichever Julian Date component has smaller magnitude to preserve maximum precision in the two-part representation.