So I currently have this script.
Which currently tells what time it is for you
But I want it to tell what time it is in lets say EST time.
How would I do this?
while true do
local TimeInUnix = os.time()
local Lighting = game:GetService("Lighting")
local stringToFormat = "%H:%M:%S"
local result = os.date(stringToFormat, TimeInUnix)
Lighting.TimeOfDay = result
wait(1)
end
You can get the difference between the timezone and UTC with the os.date function. local function getTimezoneOffset()
local tz = os.date("*t",os.time())
return tz.hour
end
local function getTime(…)
local args = {…}
local tz = getTimezoneOffset()
local dt = os.date("t",os.time()+tz3600)
if args[1] == nil then
return dt
else
return string.format(args[1],dt)
end
end
This will return a table with the current time in the correct timezone. You can pass in a format string to return the time in that format.