Repository navigation
Timestamps
imshooter edited this page Nov 26, 2026
·
1 revision
A Timestamp holds the seconds since 1970-01-01 00:00:00 UTC, the same value as gettime. A cell holds it up to 2038-01-19.
| Tag | Holds |
|---|---|
Timestamp |
A moment. |
Milliseconds, Seconds, Minutes, Hours, Days, Weeks, Months, Years
|
A duration in that unit. |
TIME_UNITS lists the tags of the units, for a function that takes any of them: Function({TIME_UNITS}:duration).
new const
Timestamp:now = Now(),
Timestamp:expiry = now + Days:30
;
new const
Seconds:left = expiry - now
;- A
Timestampwith seconds, minutes, hours, days or weeks added or taken away is aTimestamp. - Months and years follow the calendar in the zone of the server, as AddTimestampMonths does.
- Two timestamps taken one from the other give
Seconds.
Each unit in the smaller ones, named UnitInUnits, as MinuteInSeconds, DayInHours and WeekInDays. A month and a year are averages of 30.44 and 365.24 days, but MonthInDays is 30 and YearInDays is 365.
new const
Seconds:cooldown = Seconds:(5 * _:MinuteInSeconds)
;INVALID_TIMESTAMP is what MakeTimestamp and AddTimestampMonths return for a time a cell cannot hold.
Chrono 0.2.0 · Repository · Releases · MIT License
Guides
Reference
Functions