Skip to main content

Module clock

Module clock 

Source
Expand description

Heuristic detection of system-clock manipulation (backward/forward jumps).

Functions§

clock_manipulated
True if the (last_seen, now) pair indicates clock tampering (parity with Swift).
clock_rolled_back
True if now is more than the backward tolerance behind last_seen — i.e. the clock was rolled back since the last recorded contact. Unlike clock_manipulated, this omits the forward-jump/offline-ceiling component, so it can gate the read-only crate::Keylight::state resolver without governing offline duration (that stays with max_offline_days). Operates on UTC epoch seconds, so timezone changes never trip it.