GetTime

From Wiki G1R-MP G1 Remake Multiplayer
Revision as of 09:53, 15 August 2026 by QCherry (talk | contribs) (Complete Lua function catalog)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.