query · world.calendar
World calendar
Returns the current detached calendar day, clock, season, and day kind.
world.calendar.current(filters?, cursor?, page_size?) -> query-page
- Stable ID
world.calendar.current- Owner
- sim.world-environment
- Authority
- read_only
- Timing
- immediate
- Availability
- active-session
- Side effects
- none
- Determinism
- stable owner order at the current committed tick
- Introduced
- 1.6.0
Usage
Read the current World day, season, clock, day kind, and schedule window. Every field is derived from the authoritative fixed tick and calendar policy; the query cannot change time.
Parameters
- filters: no filters are required.
- cursor: optional continuation cursor; this single-record query normally returns none.
- page_size: positive record limit capped by the host.
Returns
One detached calendar record containing fixed tick, absolute day, year, day positions, weekday, hour, minute, day kind, season, and schedule window.
Cost
Constant-time calendar derivation within the package query budget; no population or environment scan.
Fields
| ID | Type | Units | Required | Description |
|---|---|---|---|---|
absolute_day | unsigned-integer | days | yes | Days elapsed since the world epoch. |
day_kind | enumeration | none | yes | Ordinary, rest-day, or festival schedule. |
day_of_season | unsigned-integer | days | yes | Zero-based day within the current season. |
day_of_week | unsigned-integer | days | yes | Zero-based weekday. |
day_of_year | unsigned-integer | days | yes | Zero-based day within the current year. |
hour | unsigned-integer | hours | yes | Hour of day. |
minute | unsigned-integer | minutes | yes | Minute within the current hour. |
season | enumeration | none | yes | Current season. |
tick | unsigned-integer | ticks | yes | Current fixed simulation tick. |
ticks_per_day | unsigned-integer | ticks | yes | Authored fixed ticks per day. |
window | enumeration | none | yes | Current broad time window. |
year | unsigned-integer | years | yes | Zero-based world year. |
Errors
error.capability-unavailableerror.invalid-queryerror.query-budget-exhaustederror.query-contract-violation
Examples
local result = world.query("world.calendar.current", {page_size = 1})
if result.status == "completed" then
local calendar = result.records[1]
ui.row("World time", "Day " .. tostring(calendar.absolute_day + 1) .. " " .. tostring(calendar.hour) .. ":" .. tostring(calendar.minute))
end
API history
- 1.6.0: Derived World clock and day-kind query added for Phase 17A.
Related symbols
world.calendarworld.actor.routineerror.capability-unavailableerror.invalid-queryerror.query-budget-exhaustederror.query-contract-violationworld.query