Skip to main content

Module clock

Module clock 

Expand description

The clock as a person reads it: local date and time.

local_now is the wall clock in the local time zone. Read it instead of chrono::Local::now(): a screenshot capture pins it (freeze_for_capture) so a frame shows the same date and time on every run, and an app that reads the system clock directly breaks that.

time_of_day renders a time the way the person reads clocks, in the TimeStyle they chose in Settings. Every clock display goes through it rather than a fixed %H:%M.

Clock types and epoch readings are ui::time’s.

Enums§

TimeStyle
How times of day render: the shared locale.time_format setting.

Constants§

CAPTURE_LOCAL_TIME
The local date and time every screenshot capture shows: 30 June 2026, 10:42.

Functions§

freeze_for_capture
Pin the wall clock to CAPTURE_LOCAL_TIME in the local time zone for the rest of the process. The launcher calls this before it builds an app for --shots; never call it in a live session.
hour_minute
time_of_day for a time kept as an hour (0..24) and a minute.
local_now
The current local date and time.
time_of_day
time as the person reads clocks: 14:05 or 2:05 PM.
today
Today’s local date.