GetTime
getTime
Returns the authoritative in-game time maintained by the server.
Syntax
int hour, int minute, int day = getTime()
Parameters
This function does not accept parameters.
Returns
Returns three integers: hour from 0 to 23, minute from 0 to 59, and the current day.
Examples
Print the current server time:
local hour, minute, day = getTime()
outputDebugString(string.format("Day %d, %02d:%02d", day, hour, minute))
Notes
- Available only in server-side resource scripts.
- The server is authoritative. Connected clients receive reliable snapshots and periodic clock corrections.