How can I restrict os.time to a timezone

I’m trying to make a gui which shows real time. But I want it to only show GMT Not anything else. How would I do this? Here’s the script

wait(5)
local timeLabel = game.Players.LocalPlayer.PlayerGui.Time
local hourChanged = true

while wait() do
	local minutes = os.date("*t")["min"]
	local hours = os.date("*t")["hour"]
	local seconds = os.date("*t")["sec"]

	if tonumber(seconds) <= 9 then
		seconds = "0"..seconds
	end
	
	if tonumber(minutes) <= 9 then
		minutes = "0"..minutes
	end

	if tonumber(hours) <= 9 then
		hours = "0"..hours 
	end

	timeLabel.TextLabel.Text = hours..":"..minutes
end
1 Like

Try this API, if you choose to. It includes use of, but not limited to, ToLocalTime.

Alternatively, mathematically calculate from universal time and then adding or subtracting to the correct one. Please be aware that some time zones use daylight saving.

2 Likes