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) -> Self
pub fn new(seconds: i64, nanos: u32) -> Self
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) -> Self
pub fn from_julian_date(jd: JulianDate) -> Self
Creates TAI from a JulianDate.
Sourcepub fn from_julian_date_raw(jd1: f64, jd2: f64) -> Self
pub fn from_julian_date_raw(jd1: f64, jd2: f64) -> Self
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() -> Self
pub fn j2000() -> Self
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) -> Self
pub fn add_seconds(&self, seconds: f64) -> Self
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) -> Self
fn from(jd: JulianDate) -> Self
Source§impl FromStr for TAI
impl FromStr for TAI
Source§fn from_str(s: &str) -> TimeResult<Self>
fn from_str(s: &str) -> TimeResult<Self>
Parses an ISO 8601 datetime string as TAI.
The input is interpreted directly as TAI with no UTC-to-TAI conversion. For UTC input, parse as UTC first, then convert to TAI.
Source§impl ToGPS for TAI
TAI to GPS conversion. Subtracts 19 seconds.
impl ToGPS for TAI
TAI to GPS conversion. Subtracts 19 seconds.
Source§fn to_gps(&self) -> TimeResult<GPS>
fn to_gps(&self) -> TimeResult<GPS>
Converts TAI to GPS time by subtracting the fixed 19-second offset.
The offset is subtracted from the smaller-magnitude JD component to preserve precision.
Source§impl ToTAI for TAI
Identity conversion for TAI.
impl ToTAI for TAI
Identity conversion for TAI.
Source§fn to_tai(&self) -> TimeResult<TAI>
fn to_tai(&self) -> TimeResult<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§fn to_tcg(&self) -> TimeResult<TCG>
fn to_tcg(&self) -> TimeResult<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.
Source§fn to_tt(&self) -> TimeResult<TT>
fn to_tt(&self) -> TimeResult<TT>
Source§impl ToUT1WithOffset for TAI
impl ToUT1WithOffset for TAI
Source§fn to_ut1_with_offset(&self, ut1_tai_offset_seconds: f64) -> TimeResult<UT1>
fn to_ut1_with_offset(&self, ut1_tai_offset_seconds: f64) -> TimeResult<UT1>
Source§impl ToUTC for TAI
impl ToUTC for TAI
Source§fn to_utc(&self) -> TimeResult<UTC>
fn to_utc(&self) -> TimeResult<UTC>
Convert TAI to UTC using iterative refinement.
Uses 3 iterations to converge on the correct UTC instant, handling leap second boundaries where a single TAI instant may map to the leap second itself.