Skip to main content

Module temporal

Module temporal 

Source
Expand description

Calendar arithmetic (Howard Hinnant’s algorithms) and the clock.

Functions§

clear_fixed_clock
Restore the system clock.
date_add_span
Add months and days to a date (calendar-aware). Uses Howard Hinnant’s date algorithms for correct month-end handling (e.g. Jan 31 + 1 month → Feb 28/29).
days_in_month
The number of days in a given month (1-indexed).
moment_add_span
Add a calendar span (months then days) to a SmoothUTC instant — the civil (wall-clock) operation: months clamp at end-of-month and respect leap years, the time-of-day rides along untouched. Distinct from adding a physical Duration (which is just nanosecond arithmetic). Delegates to the same base::temporal::add_span the AOT mirror uses, so the tiers cannot diverge.
now
The now builtin identifier.
set_fixed_clock
Pin today/now to a fixed instant (tests).
today
The today builtin identifier.