#date #time #barycentric #leap-second #tai

hifitime

Precise date and time handling in Rust built on top of std::f64 with leap second support

19 releases (12 stable)

1.0.11 Apr 23, 2020
1.0.10 Feb 26, 2020
1.0.9 Dec 21, 2019
1.0.7 Nov 27, 2019
0.0.1 Dec 30, 2017

#15 in Date and time

Download history 36/week @ 2020-03-10 66/week @ 2020-03-17 41/week @ 2020-03-24 22/week @ 2020-03-31 64/week @ 2020-04-07 93/week @ 2020-04-14 28/week @ 2020-04-21 29/week @ 2020-04-28 29/week @ 2020-05-05 13/week @ 2020-05-12 13/week @ 2020-05-19 35/week @ 2020-05-26 63/week @ 2020-06-02 8/week @ 2020-06-09 27/week @ 2020-06-16 14/week @ 2020-06-23

188 downloads per month
Used in nyx-space

Apache-2.0

75KB
1K SLoC

hifitime 1.0

Precise date and time handling in Rust built on top of std::f64. The Epoch used is TAI Epoch of 01 Jan 1900 at midnight, but that should not matter in day-to-day use of this library.

Build Status hifitime on crates.io hifitime on docs.rs

Features

  • Leap seconds (as announced by the IETF on a yearly basis)
  • Julian dates and Modified Julian dates
  • Clock drift via oscillator stability for simulation of time measuring hardware (via the simulation feature)
  • UTC representation with ISO8601 formatting (and parsing in that format #45)
  • High fidelity Ephemeris Time / Dynamic Barycentric Time (TDB) computations from ESA's Navipedia (caveat: up to 10ms difference with SPICE near 01 Jan 2000)
  • Support for custom representations of time (e.g. NASA GMAT Modified Julian Date)
  • Trivial support of other time representations, such as TDT (cf #44)

Almost all examples are validated with external references, as detailed on a test-by-test basis.

Notes

Leap second support

Each time computing library may decide when the extra leap second exists as explained in the IETF leap second reference. To ease computation, hifitime decides that second is the 60th of a UTC date, if such exists. Note that this second exists at a different time than defined on NASA HEASARC. That tool is used for validation of Julian dates. As an example of how this is handled, check the Julian day computations for 2015-06-30 23:59:59, 2015-06-30 23:59:60 and 2015-07-01 00:00:00.

Ephemeris Time vs Dynamic Barycentric Time (TDB)

ET and TDB should now be identical. However, hifitime uses the European Space Agency's definition of TDB, detailed here. It seems that SPICE uses the older definition which has a fixed offset from TDT of 0.000935 seconds. This difference is more prominent around the TDB epoch of 01 January 2000.

Dependencies

~2MB
~48K SLoC