heres a function to convert localtime to UTC time
Quote:
function getTimeTable()
local uTime, tTime, uSec, uHours, uMin, suf
local rTab = {};
tTime = Turbine.Engine:GetLocalTime();
uTime = tTime / 86400
uTime = math.floor(uTime)
uSec = tTime % 86400
uHours = math.floor(uSec / 3600)
uSec = uSec % 3600
uMin = math.floor(uSec / 60)
uSec = uSec % 60
if(uSec >= 1)then
if(uHours >= 12 ) then
suf = 1 -- pm
else
suf = 0 -- am
end
end
rTab.hours = uHours
rTab.min = uMin
rTab.sec = uSec
rTab.suffix = suf
return rTab
end
local bTab = getTimeTable();
Turbine.Shell.WriteLine("hours- " .. bTab.hours .. " min- " .. bTab.min .. " sec-" .. bTab.sec );
|
to obtain EDT EST PST etc just add or subtract to the hours output
__________________
LOTRO 50 burglar , 23 cap, 23 hunter, 23 gaurd, 23 lm, 23 champ
WoW 85 every class alliance , addon author and power leveling guide author (  yes, i know way to much time on my hands ... but but i started when vanilla hit retail if that makes it any better ha )
AoC 65 bear shaman-wiccana (lvling guide contributor)
RL Web and Desktop application dev and dad now 
Last edited by itsallhype820 : 10-20-2011 at 03:00 PM.
|