clockString() -> string
The time of day as text, HH:MM in 24-hour form, for a readout.
uiLabel("clock", clockString())
28 time commands, generated from the engine's own registry — signatures, parameters and a worked example each. A does something command acts on the game; a needs x() one answers a confident wrong answer when its client hooks are missing.
clockString() -> string
The time of day as text, HH:MM in 24-hour form, for a readout.
uiLabel("clock", clockString())
dateString() -> string
The date alone as "2026-08-19" — the day half of timestamp(), for keying a daily tally.
print(dateString())
dayName() -> string
The name of today's day of the week, like "Monday".
uiLabel("day", dayName())
dayOfMonth() -> int
The day of the month right now, 1 to 31.
print("day", dayOfMonth())
dayOfWeek() -> int
The day of the week right now, 1 for Monday through 7 for Sunday.
if dayOfWeek() == 6 { print("saturday") }
dayOfYear() -> int
Which day of the year today is, 1 to 366.
print(dayOfYear())
daysBetween(year1: int, month1: int, day1: int, year2: int, month2: int, day2: int) -> int
How many days lie from the first date to the second — negative when the second is earlier. Refuses a date the calendar does not have.
| Parameter | Type | What it does |
|---|---|---|
| year1required | int | the first date's year |
| month1required | int | the first date's month, 1 to 12 |
| day1required | int | the first date's day of the month |
| year2required | int | the second date's year |
| month2required | int | the second date's month, 1 to 12 |
| day2required | int | the second date's day of the month |
print(daysBetween(2026, 1, 1, 2026, 8, 19))
daysInMonth(year: int, month: int) -> int
How many days a month has in a given year — February answers 28 or 29 by the year. Refuses a month outside 1 to 12.
| Parameter | Type | What it does |
|---|---|---|
| yearrequired | int | the year the month is in |
| monthrequired | int | the month, 1 for January to 12 for December |
print(daysInMonth(2026, 2))
elapsedSince(millis: int) -> int
How many milliseconds have passed since an earlier nowMillis. Save a start and pass it here to time something.
| Parameter | Type | What it does |
|---|---|---|
| millisrequired | int | an earlier nowMillis reading |
if elapsedSince(0) > 0 { print("time has passed") }
epochDays() -> int
Today as a count of days since 1970 — one number a day, for date arithmetic and daily keys that sort.
print(epochDays())
formatDuration(millis: int) -> string
A length of time written for a person, like "1h 5m 3s". Zero reads as "0s".
| Parameter | Type | What it does |
|---|---|---|
| millisrequired | int | a length of time in milliseconds |
uiLabel("ran", formatDuration(elapsedSince(0)))
hourNow() -> int
The hour of the day right now, 0 to 23, on the machine's clock. For 'only run in the evenings' without the schedule grid.
if hourNow() >= 23 { stop }
isLeapYear(year: int) -> bool
True when a year has the 29th of February in it.
| Parameter | Type | What it does |
|---|---|---|
| yearrequired | int | the year to ask about |
if isLeapYear(2028) { print("leap") }
isWeekday() -> bool
True when today is Monday to Friday, on the machine's clock.
if isWeekday() { print("weekday") }
isWeekend() -> bool
True when today is Saturday or Sunday, on the machine's clock.
if isWeekend() { print("weekend") }
millisOfTicks(ticks: int) -> int
How many milliseconds a number of game ticks is — the other half of ticksOf. Faults on overflow.
| Parameter | Type | What it does |
|---|---|---|
| ticksrequired | int | a number of game ticks |
print(millisOfTicks(5))
minuteNow() -> int
The minute of the hour right now, 0 to 59.
print("minute", minuteNow())
minutesSinceMidnight() -> int
How many minutes of today have passed, 0 to 1439 — the number the schedule grid thinks in.
print(minutesSinceMidnight())
monthName() -> string
The name of the current month, like "January".
uiLabel("month", monthName())
monthNow() -> int
The month right now, 1 for January through 12 for December.
print("month", monthNow())
nowMillis() -> int
The number of milliseconds since 1970 — the wall clock as one number. Save it and compare it later to time how long something took.
let started = nowMillis() print(started)
secondNow() -> int
The second of the minute right now, 0 to 59.
print("second", secondNow())
secondsUntilHour(hour: int) -> int
How many seconds until the clock next reads an hour — today if it is still ahead, tomorrow otherwise. Refuses an hour outside 0 to 23.
| Parameter | Type | What it does |
|---|---|---|
| hourrequired | int | the hour to wait for, 0 to 23 |
print(secondsUntilHour(21))
ticksOf(millis: int) -> int
How many game ticks a length of time is — one tick is 600 milliseconds, rounded down.
| Parameter | Type | What it does |
|---|---|---|
| millisrequired | int | a length of time in milliseconds |
print(ticksOf(3000))
timeOfDay() -> string
A word for the part of the day right now: night, morning, afternoon or evening.
if timeOfDay() == "night" { stop }
timestamp() -> string
The date and time as one sortable line: "2026-08-19 14:03:59" — for a print or a saved setting a person reads later.
print(timestamp())
weekOfYear() -> int
Which week of the year this is, 1 to 53, weeks starting Monday.
print(weekOfYear())
yearNow() -> int
The year right now, as a four-digit number.
print("year", yearNow())