
- ESX
- QBCore
- vRP
By Luke

This small development resource makes every connected client display the FXServer host’s UTC time. Use it only when it is the sole owner of the game clock. If your framework already manages time and weather, configure or extend that resource instead of running two clock systems.
This example requires state-awareness support for GlobalState. Stop other time/weather synchronization resources on the test instance so one controller owns the clock. It displays UTC, not the server host’s local time zone.
The configuration and code examples here target FiveM for GTA V Legacy. Enhanced has different runtime and compatibility rules; check Cfx.re’s Legacy-to-Enhanced changes before applying them to an Enhanced server.
Check that the host clock is accurate. Back up the existing time-resource configuration and use an isolated server. Create resources/[local]/utc_clock with the three files below. The server publishes time; clients cannot set GlobalState values on the server.
Save this as fxmanifest.lua:
fx_version 'cerulean'
game 'gta5'
server_script 'server.lua'
client_script 'client.lua'Save this as server.lua. The leading exclamation mark in os.date selects UTC rather than the host’s local time zone:
CreateThread(function()
while true do
local now = os.date('!*t')
GlobalState.tutorialUtcClock = {
hour = now.hour, minute = now.min, second = now.sec
}
Wait(1000)
end
end)
AddEventHandler('onResourceStop', function(name)
if name == GetCurrentResourceName() then
GlobalState.tutorialUtcClock = nil
end
end)Save this as client.lua:
CreateThread(function()
while true do
local clock = GlobalState.tutorialUtcClock
if clock then
NetworkOverrideClockTime(clock.hour, clock.minute, clock.second)
end
Wait(1000)
end
end)
AddEventHandler('onResourceStop', function(name)
if name == GetCurrentResourceName() then
NetworkClearClockTimeOverride()
end
end)This example follows a real 24-hour UTC day; it does not accelerate daylight or select a regional daylight-saving time zone. Network and scheduling delays mean it is not a precise wall-clock display. It does not synchronize weather.
See Cfx.re state bags and the clock override native before integrating the pattern into a larger resource.





