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

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

IDTypeUnitsRequiredDescription
absolute_dayunsigned-integerdaysyesDays elapsed since the world epoch.
day_kindenumerationnoneyesOrdinary, rest-day, or festival schedule.
day_of_seasonunsigned-integerdaysyesZero-based day within the current season.
day_of_weekunsigned-integerdaysyesZero-based weekday.
day_of_yearunsigned-integerdaysyesZero-based day within the current year.
hourunsigned-integerhoursyesHour of day.
minuteunsigned-integerminutesyesMinute within the current hour.
seasonenumerationnoneyesCurrent season.
tickunsigned-integerticksyesCurrent fixed simulation tick.
ticks_per_dayunsigned-integerticksyesAuthored fixed ticks per day.
windowenumerationnoneyesCurrent broad time window.
yearunsigned-integeryearsyesZero-based world year.

Errors

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

Related symbols

Project references