Expand description
Calendar arithmetic (Howard Hinnant’s algorithms) and the clock.
Functions§
- clear_
fixed_ clock - Restore the system clock.
- date_
add_ span - Add a calendar span (
months, thendays) to a date held as days since 1970-01-01 — the civilDate + Spanevery tier computes: months clamp at the end of the month and respect leap years (Jan 31 + 1 month = Feb 28/29), then whole days roll over. Month and day arithmetic wraps ati32, asIntspan arithmetic does everywhere.Date - Spanis this with both parts negated. - days_
in_ month - The number of days in a given month (1-indexed).
- fixed_
clock - The injected fixed clock
(days, nanos), orNonewhen the system clock is live. The spatial fabric reads this so anow/todaytile produces the SAME instant the VM does — a combinational circuit has no wall clock, so a deterministic differential requires an injected one (tests set it around both runs). - moment_
add_ span - Add a calendar span (
monthsthendays) 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 physicalDuration(which is just nanosecond arithmetic). Delegates to the samebase::temporal::add_spanthe AOT mirror uses, so the tiers cannot diverge. - now
- The
nowbuiltin identifier. - set_
fixed_ clock - Pin
today/nowto a fixed instant (tests). - today
- The
todaybuiltin identifier.