Originally Posted by Garkin
Now you just have to figure out how to convert GMT time to your timezone. I was thinking about something like:
Lua Code:
local correction = GetSecondsSinceMidnight() - (GetTimeStamp() % 86400)
However it probably won't work if date in timezones is different.
|
Garkin is right. Just be careful around midnight. e.g. UTC+1: 0-(23*60*60) = -82800
Lua Code:
local correction = GetSecondsSinceMidnight() - (GetTimeStamp() % 86400)
if correction < -12*60*60 then correction = correction + 86400 end
As far as I have seening GetSecondsSinceMidnight() reflects your current client settings, including daylight saving. If the date you want to correct is in another daylight saving range, the correction will differ +/- one hour.