Skip to main content

Module datetime

Module datetime 

Source
Expand description

FIT timestamp conversions.

FIT stores absolute time as a u32 count of seconds since 1989-12-31 00:00:00 UTC — 631,065,600 seconds after the Unix epoch. The chrono-based helpers (fit_to_datetime / datetime_to_fit) are only compiled when the chrono feature is enabled.

Constants§

FIT_EPOCH_OFFSET_SECS
Seconds between Unix epoch (1970-01-01) and FIT epoch (1989-12-31).

Functions§

datetime_to_fit
Inverse of fit_to_datetime. Returns None if the datetime is before the FIT epoch or beyond u32::MAX seconds after it (≈ year 2125).
fit_to_datetime
Convert a FIT timestamp (seconds since FIT epoch) into a UTC datetime.