Skip to main content

Module time_service

Module time_service 

Source
Expand description

ITS time utilities.

The ITS epoch is 2004-01-01 00:00:00 UTC (TAI), which corresponds to Unix timestamp 1072915200. A leap-second offset of 5 s is added to convert from UTC to TAI.

Constants§

ELAPSED_MILLISECONDS
ELAPSED_SECONDS in milliseconds.
ELAPSED_SECONDS
Leap seconds inserted since the ITS epoch (TAI − UTC drift since 2004: 2005, 2008, 2012, 2015 and 2016). TimestampIts counts TAI milliseconds (ETSI TS 102 894-2), so this offset is added to UTC time.
ITS_EPOCH
Unix timestamp of the ITS epoch (2004-01-01T00:00:00 UTC).
ITS_EPOCH_MS
ITS_EPOCH in milliseconds.

Functions§

time
Parity alias for Python TimeService.time().
timestamp_its
Parity alias for Python TimeService.timestamp_its() (returns milliseconds).
timestamp_its_microseconds
Return the current ITS timestamp in microseconds (TAI, ITS epoch).
unix_ms_to_its_ms
Convert a Unix (UTC) timestamp in ms to ITS time (TAI ms since the ITS epoch), i.e. the TimestampIts of ETSI TS 102 894-2. Saturates at 0.
unix_time_secs
Return the current UTC timestamp in seconds (as f64).