#[non_exhaustive]#[repr(u8)]pub enum Scale {
Show 16 variants
TAI = 0,
TT = 1,
ET = 2,
TDB = 3,
UTC = 4,
UtcSpice = 5,
UtcHist = 6,
GPS = 7,
GST = 8,
BDT = 9,
QZSS = 10,
TCG = 11,
TCB = 12,
LTC = 13,
TCL = 14,
Custom = 15,
}Expand description
Time scales supported by the library.
This #[non_exhaustive] enum defines all time scales that Dt can represent.
Each Dt instance stores its internal time value on the scale indicated by
its scale field.
The reference epoch used for conversions between scales is 2000-01-01 12:00:00 TAI.
§UTC Variants and Leap Seconds
The library supports three UTC variants:
UTC— Modern UTC using the built-in IERS leap second table (recommended for most uses).UtcSpice— SPICE-compatible model with a fixed +9 s offset before 1972-01-01.UtcHist— Historical SOFA model with piecewise linear offsets (“rubber seconds”) from 1961–1972. Round-tripping is not supported for this variant.
§Supported Time Scales
| Scale | Description |
|---|---|
TAI | International Atomic Time. The primary internal continuous atomic time scale. |
TT | Terrestrial Time. Smooth atomic time used in astronomy and dynamics (TAI + 32.184 s). |
ET | Ephemeris Time using the NAIF/SPICE simplified model (~30 µs accuracy). Matches NASA/NAIF SPICE for interoperability. Use TDB for higher-fidelity. |
TDB | Barycentric Dynamical Time. High-fidelity relativistic ephemeris time (DE440/LTE440 + VSOP2013 tuned model). |
UTC | Coordinated Universal Time using modern IERS leap second rules. |
UtcSpice | Coordinated Universal Time using the SPICE historical model (fixed +9 s offset before 1972-01-01). |
UtcHist | Coordinated Universal Time using the historical SOFA model with “rubber seconds” (1961–1972). Round-tripping is not supported. |
GPS | GPS Time (used by the U.S. GPS navigation constellation). |
GST | Galileo Time (used by Europe’s Galileo navigation system). |
BDT | BeiDou Time (used by China’s BeiDou navigation system). |
QZSS | QZSS Time (used by Japan’s QZSS satellite system). |
TCG | Geocentric Coordinate Time. Relativistic time scale in the GCRS (Earth-centered). |
TCB | Barycentric Coordinate Time. Relativistic time scale in the BCRS (solar-system barycenter). |
LTC | Coordinated Lunar Time. Operational lunar time for cislunar use based on the LTE440 model. |
TCL | Lunar Coordinate Time. IAU relativistic coordinate time in the LCRS based on the LTE440 model. |
Custom | User-defined or experimental time scale. |
§Lunar Time Scales (LTC / TCL)
Both LTC and TCL are based on the LTE440 model (Lu et al. 2025):
LTC(Coordinated Lunar Time) — Intended for operational cislunar use. Applies a secular rate of +56.02 µs/day relative to TT plus the dominant periodic terms.TCL(Lunar Coordinate Time) — Theoretical IAU relativistic coordinate time at the Moon’s center of mass. Includes the secular rate versus TDB, periodic terms, and a J2000 bias calibrated to published LTE440 values.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TAI = 0
International Atomic Time (TAI).
TT = 1
Terrestrial Time (TT).
A smooth, continuous atomic time scale used in astronomy and dynamics (TAI + 32.184 s constant offset).
ET = 2
Ephemeris Time (NAIF/SPICE simplified model).
Uses the official NAIF simplified single-term model for interoperability
with NASA/NAIF SPICE (~30 µs accuracy). For higher-fidelity relativistic
ephemeris calculations, use TDB instead.
TDB = 3
Barycentric Dynamical Time (TDB).
High-fidelity relativistic ephemeris time tuned to DE440/LTE440 + VSOP2013. Used for precise planetary and spacecraft trajectory calculations.
UTC = 4
Coordinated Universal Time (UTC) using modern leap second rules.
UtcSpice = 5
Coordinated Universal Time using the SPICE historical model (fixed +9 s offset before 1972-01-01).
UtcHist = 6
Coordinated Universal Time using the historical SOFA model (with “rubber seconds” between 1961–1972).
Round-tripping is not supported.
GPS = 7
GPS Time.
The time scale used by the U.S. GPS satellite navigation system.
GST = 8
Galileo Time.
The time scale used by Europe’s Galileo satellite navigation system.
BDT = 9
BeiDou Time.
The time scale used by China’s BeiDou satellite navigation system.
QZSS = 10
QZSS Time.
The time scale used by Japan’s QZSS satellite system (similar to GPS).
TCG = 11
Geocentric Coordinate Time (TCG).
A relativistic time scale centered on Earth, used for high-precision work near Earth (e.g. satellite orbits).
TCB = 12
Barycentric Coordinate Time (TCB).
A relativistic time scale for the entire solar system.
LTC = 13
Coordinated Lunar Time (LTC).
Operational lunar time scale intended for cislunar operations. Based on the LTE440 model.
TCL = 14
Lunar Coordinate Time (TCL).
Theoretical relativistic coordinate time at the Moon’s center of mass. Based on the LTE440 model.
Custom = 15
Custom / user-defined scale.
Implementations§
Source§impl Scale
impl Scale
Sourcepub const fn to_utc(&self) -> Scale
pub const fn to_utc(&self) -> Scale
Converts this Scale to UTC.
- If the scale is already one of the UTC variants including historical UTC then no change occurs.
Sourcepub const fn uses_leap_seconds(&self) -> bool
pub const fn uses_leap_seconds(&self) -> bool
Returns true if this scale accounts for leap seconds
(or historical UTC civil time rules).
Sourcepub const fn is_gnss(&self) -> bool
pub const fn is_gnss(&self) -> bool
Returns true if this scale is based off a GNSS constellation.
Sourcepub fn from_abbrev(s: &str) -> Option<Self>
pub fn from_abbrev(s: &str) -> Option<Self>
Parse scale from abbreviation.
Returns None for any non-ASCII input.
Sourcepub const fn abbrev(&self) -> &'static str
pub const fn abbrev(&self) -> &'static str
Short abbreviation used for formatting / display (e.g. “TAI”, “UTC”, “UtcSpice”).
Trait Implementations§
impl Copy for Scale
Source§impl<'de> Deserialize<'de> for Scale
impl<'de> Deserialize<'de> for Scale
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Scale
Source§impl Ord for Scale
impl Ord for Scale
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Scale
impl PartialOrd for Scale
impl StructuralPartialEq for Scale
Source§impl Tsify for Scale
impl Tsify for Scale
const DECL: &'static str = "/**\n * Time scales supported by the library.\n *\n * This `#[non_exhaustive]` enum defines all time scales that [`Dt`](struct.Dt.html) can represent.\n * Each [`Dt`](struct.Dt.html) instance stores its internal time value on the scale indicated by\n * its `scale` field.\n *\n * The reference epoch used for conversions between scales is **2000-01-01 12:00:00 TAI**.\n *\n * ## UTC Variants and Leap Seconds\n *\n * The library supports three UTC variants:\n *\n * - **`UTC`** \u{2014} Modern UTC using the built-in IERS leap second table (recommended for most uses).\n * - **`UtcSpice`** \u{2014} SPICE-compatible model with a fixed +9 s offset before 1972-01-01.\n * - **`UtcHist`** \u{2014} Historical SOFA model with piecewise linear offsets (\u{201c}rubber seconds\u{201d}) from 1961\u{2013}1972.\n * Round-tripping is **not supported** for this variant.\n *\n * ## Supported Time Scales\n *\n * | Scale | Description |\n * |-------------|-------------|\n * | `TAI` | International Atomic Time. The primary internal continuous atomic time scale. |\n * | `TT` | Terrestrial Time. Smooth atomic time used in astronomy and dynamics (TAI + 32.184 s). |\n * | `ET` | Ephemeris Time using the **NAIF/SPICE simplified model** (~30 \u{b5}s accuracy). Matches NASA/NAIF SPICE for interoperability. Use `TDB` for higher-fidelity. |\n * | `TDB` | Barycentric Dynamical Time. High-fidelity relativistic ephemeris time (DE440/LTE440 + VSOP2013 tuned model). |\n * | `UTC` | Coordinated Universal Time using modern IERS leap second rules. |\n * | `UtcSpice` | Coordinated Universal Time using the SPICE historical model (fixed +9 s offset before 1972-01-01). |\n * | `UtcHist` | Coordinated Universal Time using the historical SOFA model with \u{201c}rubber seconds\u{201d} (1961\u{2013}1972). Round-tripping is not supported. |\n * | `GPS` | GPS Time (used by the U.S. GPS navigation constellation). |\n * | `GST` | Galileo Time (used by Europe\u{2019}s Galileo navigation system). |\n * | `BDT` | BeiDou Time (used by China\u{2019}s BeiDou navigation system). |\n * | `QZSS` | QZSS Time (used by Japan\u{2019}s QZSS satellite system). |\n * | `TCG` | Geocentric Coordinate Time. Relativistic time scale in the GCRS (Earth-centered). |\n * | `TCB` | Barycentric Coordinate Time. Relativistic time scale in the BCRS (solar-system barycenter). |\n * | `LTC` | Coordinated Lunar Time. Operational lunar time for cislunar use based on the LTE440 model. |\n * | `TCL` | Lunar Coordinate Time. IAU relativistic coordinate time in the LCRS based on the LTE440 model. |\n * | `Custom` | User-defined or experimental time scale. |\n *\n * ## Lunar Time Scales (LTC / TCL)\n *\n * Both `LTC` and `TCL` are based on the **LTE440** model (Lu et al. 2025):\n *\n * - `LTC` (Coordinated Lunar Time) \u{2014} Intended for operational cislunar use. Applies a secular rate of **+56.02 \u{b5}s/day** relative to TT plus the dominant periodic terms.\n * - `TCL` (Lunar Coordinate Time) \u{2014} Theoretical IAU relativistic coordinate time at the Moon\u{2019}s center of mass. Includes the secular rate versus TDB, periodic terms, and a J2000 bias calibrated to published LTE440 values.\n */\nexport type Scale = \"TAI\" | \"TT\" | \"ET\" | \"TDB\" | \"UTC\" | \"UtcSpice\" | \"UtcHist\" | \"GPS\" | \"GST\" | \"BDT\" | \"QZSS\" | \"TCG\" | \"TCB\" | \"LTC\" | \"TCL\" | \"Custom\";"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Auto Trait Implementations§
impl Freeze for Scale
impl RefUnwindSafe for Scale
impl Send for Scale
impl Sync for Scale
impl Unpin for Scale
impl UnsafeUnpin for Scale
impl UnwindSafe for Scale
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.