View Single Post
12/19/14, 09:47 AM   #3
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 578
Originally Posted by Garkin View Post
Now you just have to figure out how to convert GMT time to your timezone. I was thinking about something like:
Lua Code:
  1. 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:
  1. local correction = GetSecondsSinceMidnight() - (GetTimeStamp() % 86400)
  2. 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.

Last edited by votan : 12/19/14 at 12:11 PM.
  Reply With Quote