Expand description
UTC time and duration codecs for DVB wire fields.
DVB carries wall-clock time as a 16-bit Modified Julian Date plus 24-bit BCD
HHMMSS (EN 300 468 Annex C), and event durations as 24-bit BCD HHMMSS. The
duration codec is dependency-free; the MJD↔calendar conversion needs a date
library and so lives behind the chrono feature.
Structs§
- MjdBcd
Date Time - Decoded 5-byte DVB UTC time (16-bit MJD + 24-bit BCD
HHMMSS).
Constants§
- SECS_
2000_ EPOCH - Unix timestamp (seconds since Unix epoch 1970-01-01T00:00:00 UTC) of the T2-MI / DVB time-of-day epoch: 2000-01-01T00:00:00 UTC.
Functions§
- decode_
bcd_ duration - Decode a 24-bit BCD
HHMMSSduration ([HH, MM, SS]) to aDuration. - decode_
mjd_ bcd - Decode a 5-byte DVB UTC time (16-bit MJD + 24-bit BCD
HHMMSS) to a plainMjdBcdDateTime. - decode_
mjd_ bcd_ utc chrono - Decode a 5-byte DVB UTC time (16-bit MJD + 24-bit BCD
HHMMSS) to achrono::DateTime<chrono::Utc>. - decode_
seconds_ since_ 2000_ utc chrono - Decode a T2-MI
seconds_since_2000/ subsecond-nanoseconds pair to achrono::DateTime<chrono::Utc>, applying autcoleap-second offset. - encode_
bcd_ duration - Encode a whole-second
Durationto a 24-bit BCDHHMMSS([HH, MM, SS]). - encode_
mjd_ bcd - Encode a
MjdBcdDateTimeto a 5-byte DVB UTC time. - encode_
mjd_ bcd_ utc chrono - Encode a
chrono::DateTime<chrono::Utc>to a 5-byte DVB UTC time (16-bit MJD + 24-bit BCDHHMMSS). - encode_
seconds_ since_ 2000_ utc chrono - Encode a
chrono::DateTime<chrono::Utc>toseconds_since_2000with autcoleap-second offset. - mjd_
to_ ymd chrono - Convert a 16-bit Modified Julian Date to
(year, month, day). - ymd_
to_ mjd chrono - Convert a
(year, month, day)date to a 16-bit Modified Julian Date.