Quantcast heres a function to convert localtime to UTC time - LoTROInterface
VGInterface.com
Search Downloads


Go Back   LoTROInterface > LotRO > Developer Discussions > Tutorials & Other Helpful Information (L)

Reply
Thread Tools Display Modes
  #1  
Unread 10-20-2011, 02:57 PM
itsallhype820 itsallhype820 is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Oct 2011
Posts: 8
Post 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.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
function Backpack:ItemMoved(sender, args); MrJackdaw Lua Programming Help (L) 0 11-21-2010 02:28 AM
Beginners LUA Problem: Calling function located in another file lerusius Lua Programming Help (L) 5 09-30-2010 05:08 PM
Time in the game willibix Interface Help (L) 8 05-01-2007 06:09 PM
monster time problems yvette Interface Help (L) 4 02-15-2007 04:44 PM


All times are GMT -5. The time now is 02:33 AM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | VGInterface | LoTROInterface | MMOInterface | Swtorui