Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I set the in-game time to current UTC time?

I know how to get the time, but I don't know how to change the in-game time to that time.

1 answer

✓ Accepted answer

Since the TimeOfDay property is a string value, and os.date() can return the hour, minute, and second of the UTC time, we can use this.

game.Lighting.TimeOfDay = tostring(os.date("!*t").hour.. ":".. os.date("!*t").min.. ":"..os.date("!*t").sec)

Remember that UTC must have the "!*t" within the os.date() function

1 comment

0

local hour, minute, second = unpack(os.date("!*t"))

This discussion is preserved as it was. New answers, comments, and votes are closed.