Skip to main content

Module time

Module time 

Source
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.

Functions§

decode_bcd_duration
Decode a 24-bit BCD HHMMSS duration ([HH, MM, SS]) to a Duration.
decode_mjd_bcd_utcchrono
Decode a 5-byte DVB UTC time (16-bit MJD + 24-bit BCD HHMMSS) to a chrono::DateTime<chrono::Utc>.
encode_bcd_duration
Encode a whole-second Duration to a 24-bit BCD HHMMSS ([HH, MM, SS]).
encode_mjd_bcd_utcchrono
Encode a chrono::DateTime<chrono::Utc> to a 5-byte DVB UTC time (16-bit MJD + 24-bit BCD HHMMSS).
mjd_to_ymdchrono
Convert a 16-bit Modified Julian Date to (year, month, day).
ymd_to_mjdchrono
Convert a (year, month, day) date to a 16-bit Modified Julian Date.