pub struct UT1(/* private fields */);Expand description
Universal Time UT1, based on Earth’s rotation angle.
Internally stores time as a split Julian Date for full precision.
Implementations§
Source§impl UT1
impl UT1
Sourcepub fn new(seconds: i64, nanos: u32) -> Self
pub fn new(seconds: i64, nanos: u32) -> Self
Creates UT1 from Unix timestamp components.
Converts seconds and nanoseconds since Unix epoch (1970-01-01 00:00:00) to a split Julian Date representation.
Sourcepub fn from_julian_date(jd: JulianDate) -> Self
pub fn from_julian_date(jd: JulianDate) -> Self
Creates UT1 from a Julian Date.
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
Adds seconds to this UT1 instant. Negative values subtract.
Trait Implementations§
Source§impl From<JulianDate> for UT1
Converts a Julian Date to UT1.
impl From<JulianDate> for UT1
Converts a Julian Date to UT1.
Source§fn from(jd: JulianDate) -> Self
fn from(jd: JulianDate) -> Self
Converts to this type from the input type.
Source§impl FromStr for UT1
Parses UT1 from an ISO 8601 string.
impl FromStr for UT1
Parses UT1 from an ISO 8601 string.
Accepts formats like “2000-01-01T12:00:00” or “2000-01-01T12:00:00.123”.
Source§impl ToTAIWithOffset for UT1
impl ToTAIWithOffset for UT1
Source§fn to_tai_with_offset(&self, ut1_tai_offset_seconds: f64) -> TimeResult<TAI>
fn to_tai_with_offset(&self, ut1_tai_offset_seconds: f64) -> TimeResult<TAI>
Convert to TAI using the given UT1-TAI offset in seconds. Read more
Source§impl ToTTWithDeltaT for UT1
impl ToTTWithDeltaT for UT1
Source§fn to_tt_with_delta_t(&self, delta_t_seconds: f64) -> TimeResult<TT>
fn to_tt_with_delta_t(&self, delta_t_seconds: f64) -> TimeResult<TT>
Convert to TT using the given Delta-T in seconds. Read more
Source§impl ToUTCViaTAI for UT1
impl ToUTCViaTAI for UT1
Source§fn to_utc_via_tai_with_dut1(&self, dut1_seconds: f64) -> TimeResult<UTC>
fn to_utc_via_tai_with_dut1(&self, dut1_seconds: f64) -> TimeResult<UTC>
Convert UT1 to UTC by chaining: UT1 → TAI → UTC. Read more
Source§impl ToUTCWithDUT1 for UT1
impl ToUTCWithDUT1 for UT1
Source§fn to_utc_with_dut1(&self, dut1_seconds: f64) -> TimeResult<UTC>
fn to_utc_with_dut1(&self, dut1_seconds: f64) -> TimeResult<UTC>
Convert UT1 to UTC by subtracting the adjusted DUT1 offset.
The conversion:
- Determines which JD component has larger magnitude (for precision)
- Adjusts DUT1 for any nearby leap second boundaries
- Subtracts the adjusted DUT1 from the smaller-magnitude component
- Preserves the original JD component ordering
The leap second adjustment ensures correct behavior at discontinuities where the UTC scale gains an extra second.
impl Copy for UT1
impl StructuralPartialEq for UT1
Auto Trait Implementations§
impl Freeze for UT1
impl RefUnwindSafe for UT1
impl Send for UT1
impl Sync for UT1
impl Unpin for UT1
impl UnsafeUnpin for UT1
impl UnwindSafe for UT1
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more