Expand description
Time Module
This crate is a façade over tempoch-core and re-exports its public API.
§Core types
Time<S>— generic instant parameterised by aTimeScalemarker.TimeScale— trait that defines a time scale (epoch offset + conversions).JulianDate— type alias forTime<JD>.JulianEphemerisDay— type alias forTime<JDE>.ModifiedJulianDate— type alias forTime<MJD>.Period<S>— a time interval parameterised by aTimeScalemarker.Interval<T>— a generic interval over anyTimeInstant.TimeInstant— trait for points in time usable withInterval.
§Time scales
The following markers implement TimeScale:
| Marker | Scale |
|---|---|
JD | Julian Date |
JDE | Julian Ephemeris Day |
MJD | Modified Julian Date |
TDB | Barycentric Dynamical Time |
TT | Terrestrial Time |
TAI | International Atomic Time |
TCG | Geocentric Coordinate Time |
TCB | Barycentric Coordinate Time |
GPS | GPS Time |
UnixTime | Unix / POSIX time |
UT | Universal Time (Earth rotation) |
§ΔT (Delta T)
The difference ΔT = TT − UT is applied automatically by the
UT time scale. Use Time::<UT>::new(jd_ut) for UT-based values,
or construct any scale via from_utc() which routes through UT internally.
The raw ΔT value (in seconds) is available via Time::<UT>::delta_t().
Structs§
- GPS
- GPS Time — continuous day count since 1980-01-06T00:00:00 UTC.
- Interval
- Represents an interval between two instants.
- JD
- Julian Date — the identity scale.
- JDE
- Julian Ephemeris Day — dynamic Julian day used by ephemerides.
- MJD
- Modified Julian Date — JD minus 2 400 000.5.
- NonFinite
Time Error - Error returned when a
Timevalue is non-finite (NaNor±∞). - TAI
- International Atomic Time.
- TCB
- Barycentric Coordinate Time — the coordinate time for the BCRS.
- TCG
- Geocentric Coordinate Time — the coordinate time for the GCRS.
- TDB
- Barycentric Dynamical Time.
- TT
- Terrestrial Time — the basis for astronomical ephemerides.
- Time
- A point on time scale
S. - UT
- Universal Time — the civil time scale tied to Earth’s rotation.
- Unix
Time - Unix Time — seconds since 1970-01-01T00:00:00 UTC, stored as days.
Enums§
- Conversion
Error - Error returned when a period time-scale conversion fails.
- Invalid
Interval Error - Error returned when constructing an
Intervalwith invalid bounds. - Period
List Error - Error indicating a period list violates sorted/non-overlapping invariants.
Traits§
- Time
Instant - Trait for types that represent a point in time.
- Time
Scale - Marker trait for time scales.
Functions§
- complement_
within - Returns the gaps (complement) of
periodswithin the boundingouterperiod. - intersect_
periods - Returns the intersection of two sorted, non-overlapping period lists.
- normalize_
periods - Sort periods by start time and merge overlapping/adjacent intervals.
- tai_
minus_ utc - Look up cumulative TAI−UTC (leap seconds) for a JD on the UTC axis.
- validate_
period_ list - Validate that a period list is sorted by start time and non-overlapping.
Type Aliases§
- Julian
Date - Julian Date — continuous count of days since the Julian Period.
- Julian
Ephemeris Day - Julian Ephemeris Day — dynamical Julian day used by many ephemeris formulas.
- Modified
Julian Date - Modified Julian Date —
JD − 2 400 000.5. - Period
- Time-scale period alias.
- Universal
Time - Universal Time — Earth-rotation civil time scale.
- UtcPeriod
- UTC interval alias.