Repository navigation
Date Time
Frank edited this page Jan 26, 2026
·
2 revisions
CupidScript provides simple date/time helpers in the standard library.
Returns current Unix time in milliseconds.
Returns current Unix time in seconds.
Date/time functions return a map with these fields:
-
year- full year (e.g., 2026) -
month- 1-12 -
day- 1-31 -
hour- 0-23 -
minute- 0-59 -
second- 0-60 -
ms- 0-999 -
wday- day of week (0=Sunday) -
yday- day of year (1-366) -
is_dst- daylight saving time flag -
is_utc- whether the timestamp is UTC
Local time.
UTC time.
Converts Unix milliseconds to local time.
Converts Unix milliseconds to UTC.
let ms = unix_ms();
let local = datetime_now();
let utc = datetime_utc();
print("ms:", ms);
print("local:", local);
print("utc:", utc);
let epoch = datetime_from_unix_ms_utc(0);
print("epoch:", epoch.year, epoch.month, epoch.day, epoch.hour, epoch.minute, epoch.second);