I am trying to make the in game time match my time in real life.
My issue is that when I run it in studio it works and when I run it on the roblox client it sets the time wrong. Pictures: InGame|566x500 InStudio|465x454
I have tired other ways of doing this including trying a different api.
My code for my script is below.
while true do wait(1)
local HttpService = game:GetService("HttpService")
local URL_TIMECST = "http://worldtimeapi.org/api/timezone/America/Chicago"
local response = HttpService:GetAsync(URL_TIMECST)
local data = HttpService:JSONDecode(response)
local response = HttpService:GetAsync(URL_TIMECST)
local data = HttpService:JSONDecode(response)
local stringToFormat = "%X"
local timestamp = data.unixtime
local result = os.date(stringToFormat, timestamp)
game.Lighting.TimeOfDay = result
end