View Source SpaceDust.Time.Epoch (Space Dust v0.3.0)

Base module for time epoch types.

All time types store time internally as seconds since their reference epoch, enabling efficient Nx-based conversions. Each time standard has its own reference epoch and relationship to other standards.

Time Standards

  • UTC - Coordinated Universal Time (civil time, includes leap seconds)
  • TAI - International Atomic Time (continuous, no leap seconds)
  • TT - Terrestrial Time (used for ephemeris, TT = TAI + 32.184s)
  • GPS - GPS Time (GPS = TAI - 19s, started Jan 6, 1980)
  • JD - Julian Date (days since -4712 Jan 1, 12:00 TT)
  • MJD - Modified Julian Date (JD - 2400000.5)

Unix Epoch Reference

All internal representations use seconds from Unix epoch (1970-01-01 00:00:00 UTC) for efficient conversion and interoperability with Elixir DateTime.

Summary

Functions

GPS epoch in Unix seconds (1980-01-06 00:00:00 UTC)

GPS-TAI offset in seconds (constant -19s, GPS = TAI - 19)

J2000.0 epoch as Julian Date

Seconds per day

TAI-UTC offset at Unix epoch (10 leap seconds)

TT-TAI offset in seconds (constant 32.184s)

Julian Date at Unix epoch (JD 2440587.5)

Types

seconds()

@type seconds() :: float()

Functions

gps_epoch_unix()

GPS epoch in Unix seconds (1980-01-06 00:00:00 UTC)

gps_tai_offset()

GPS-TAI offset in seconds (constant -19s, GPS = TAI - 19)

j2000_jd()

J2000.0 epoch as Julian Date

seconds_per_day()

Seconds per day

tai_utc_at_unix_epoch()

TAI-UTC offset at Unix epoch (10 leap seconds)

tt_tai_offset()

TT-TAI offset in seconds (constant 32.184s)

unix_epoch_jd()

Julian Date at Unix epoch (JD 2440587.5)