Skip to main content

decode_seconds_since_2000_utc

Function decode_seconds_since_2000_utc 

Source
pub fn decode_seconds_since_2000_utc(
    seconds_since_2000: u64,
    subsec_nanos: u32,
    utco: u16,
) -> Option<DateTime<Utc>>
Available on crate feature chrono only.
Expand description

Decode a T2-MI seconds_since_2000 / subsecond-nanoseconds pair to a chrono::DateTime<chrono::Utc>, applying a utco leap-second offset.

The T2-MI spec (ETSI TS 102 773 §5.2.7) defines:

  • seconds_since_2000: whole seconds since 2000-01-01T00:00:00 UTC (the timestamp’s own time base, not civil UTC).
  • utco: the number of leap seconds to subtract from the timestamp’s time base to obtain civil UTC. At publication of the spec this was 34 s.
  • subsec_nanos: sub-second component in nanoseconds (caller converts from the bandwidth-dependent subseconds field).

Returns None if the resulting timestamp is out of range.