GetTime: Difference between revisions
Jump to navigation
Jump to search
Automatyczna aktualizacja dokumentacji funkcji |
Complete Lua function catalog |
||
| Line 25: | Line 25: | ||
* The server is authoritative. Connected clients receive reliable snapshots and periodic clock corrections. | * The server is authoritative. Connected clients receive reliable snapshots and periodic clock corrections. | ||
[[Category:Lua Functions]] | |||
[[Category:Server Functions]] | [[Category:Server Functions]] | ||
[[Category:World Functions]] | [[Category:World Functions]] | ||
Latest revision as of 09:53, 15 August 2026
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.