Expand description
Experimental timescales for spacecraft, the Moon, and the solar system.
Status: 0.1 work-in-progress. APIs may break. Not flight-qualified. Lunar TCL is origin-only (no IAU periodic series). Time zones are a seven-zone subset, not the IANA tzdb. Coordinated Lunar Time (LTC) is provisional. UT1/DUT1 is a pinned IERS C04 table (not CIP/CIO polar motion).
An instant is not a calendar. The core stores TAI nanoseconds since
1958-01-01 00:00:00 TAI. UTC leap seconds, DST, sols, and lunar clocks are
projections of that value. There is no now(); inject a clock.
Cost model (earth feature): TAI arithmetic is the hot core. Reconstructing
civil UTC from an arbitrary Instant (to_utc) is a convenience search.
Same-day telemetry should pin a UtcDay and use dut1_at / era_at_utc.
use satellite_datetime::{Duration, Instant};
let t = Instant::TAI_EPOCH
.checked_add(Duration::from_seconds(1))
.unwrap();
assert_eq!(t.as_tai_nanos(), 1_000_000_000);Enable --no-default-features for the satellite (no_std, no allocator) profile.
API docs: https://docs.rs/satellite-datetime. Locally: cargo doc --open.
Re-exports§
pub use duration::Duration;pub use error::Error;pub use error::Result;pub use instant::Instant;pub use julian::civil_from_unix_days;pub use julian::unix_days_from_civil;pub use julian::JulianDate;pub use scale::Bdt;pub use scale::Gps;pub use scale::Gst;pub use scale::Ltc;pub use scale::Reading;pub use scale::Scale;pub use scale::Tai;pub use scale::Tcb;pub use scale::Tcg;pub use scale::Tcl;pub use scale::Tdb;pub use scale::Tt;pub use earth::dut1_at;earthpub use earth::era_at_utc;earthpub use earth::format_rfc3339;earthpub use earth::gmst_mean_at_utc;earthpub use earth::julian_ut1_at;earthpub use earth::parse_rfc3339;earthpub use earth::utc_mjd;earthpub use earth::CivilUtc;earthpub use earth::UtcContext;earthpub use earth::UtcDay;earth
Modules§
- bodies
bodies - Generic solar-system bodies: IAU WGCCRE prime-meridian rotation (sidereal).
- ccsds
ccsds - CCSDS 301.0-B-4 time codes. Recommended epoch: 1958-01-01 TAI (no leap seconds).
- duration
- SI durations. Never a calendar day, never a leap second.
- earth
earth - Earth civil time: leap seconds, Gregorian, ISO 8601, POSIX Unix, DUT1, ERA.
- error
- Errors that never panic on library paths.
- gnss
gnss - GNSS system times as uniform offsets from TAI.
- instant
- Physical instants stored as TAI nanoseconds since 1958-01-01 00:00:00 TAI.
- julian
- Two-part Julian dates and day counts.
- lunar
lunar - Lunar Coordinate Time (IAU 2024 TCL) and provisional Coordinated Lunar Time.
- mars
mars - Mars Sol Date and Coordinated Mars Time (Allison & McEwen / NASA GISS Mars24).
- scale
- Named timescales. Phantom types prevent mixing readings.
- tz
tz - IANA-compatible time zones with DST gaps and overlaps.
Constants§
- BDT_
MINUS_ TAI - BDT − TAI = −33 s.
- GPS_
MINUS_ TAI - GPS − TAI = −19 s.
- IAU_
1977_ JD - 1977-01-01 00:00:00 TAI = JD 2443144.5. IAU origin of TT/TCG/TCB relations.
- J2000_
JD - J2000.0 TT = 2000-01-01 12:00:00 TT = JD 2451545.0.
- LTC_
DEFINITION_ STATUS - IAU 2024: at the defining event, TCL = TCB = 1977-01-01 00:00:32.184. That TCB reading is TT at the 1977 TAI midnight plus 32.184 s = TAI 1977 + 32.184 s.
- LUNAR_
SURFACE_ MINUS_ TT_ PER_ DAY - Mean lunar surface proper time minus TT (Ashby & Patla 2024 class result). Clocks on the Moon run faster than TT by about 56.02 µs per terrestrial day.
- L_B
- IAU 2006 L_B: TCB − TDB rate.
- L_G
- IAU 2000 L_G: TCG − TT rate.
- NS_
PER_ DAY - Nanoseconds in a 86400-second nominal day.
- NS_
PER_ SEC - Nanoseconds in one SI second.
- TAI_
1977_ NS - TAI nanoseconds from 1958-01-01 to 1977-01-01 00:00:00 TAI. 19 y including leap days 1960,1964,1968,1972,1976 = 19*365+5 = 6940 days.
- TAI_
EPOCH_ JD - Julian Date of 1958-01-01 00:00:00 (TAI epoch, CCSDS).
- TAI_
EPOCH_ MJD - Modified Julian Date of the TAI epoch.
- TAI_
EPOCH_ UNIX_ DAYS - Unix day number of the TAI epoch (days since 1970-01-01).