can anyone make me a script that displays the hub time and other timezones ??
e.g.
hub time: 02:06 [gmt]
sweden: 03:06
india : 06:35
it has been done already, search the forum !!
i have looked ?( where is it please
hmm, sorry i thought it already existed,
hubtime is simple to do, now other timezones that would b a bit challenging, theres quite a lot of countries in the world, even though they all follow a pattern, ud need to have a reference for all of them, or do u just want it for each continent?
i would only add the timezones of the people in my hub, i only run a small hub for friends, so i would have the swedish time, finnish time, british time, hongkong and india
doesnt sound easy does it
not very hard, btw, can u give me the timezones for each of those, in comparison to gmt ?
--Timezone script
--Requested by -3sixty-
--By Dessamator
--Cmds : !time & !timezone
-- Config --
urTime="2" -- ur local time in comparison to GMT
bot=frmHub:GetHubBotName() -- ur bot name
--The timezones for each country
tTimeZone = {
["Britain"] = 0,
["Honk Kong"] = 8,
["Sweden"] = 2,
["Finland"] = 3,
["India"] = 3,
["Hub Time"] = urTime,
}
-- Config End--
function ChatArrival(user,data)
local temp,hour ="\r\n\t\t".."Timezones: ".."\r\n".."\t".."Country".."\t\t\t".."Time".."\r\n\t"..string.rep("??",16).."\r\n",(os.date("%H"))
if hour== 0 or 1 then
hour=24-urTime
else
hour=(os.date("%H"))-urTime
end
data=string.sub(data,1,string.len(data)-1)
local s,e,cmd = string.find(data,"%b<>%s+(%S+)")
if cmd =="!time" then
user:SendPM(bot,os.date("The Current time is : %X"))
return 1
elseif cmd=="!timezone" then
for country,time in tTimeZone do
if string.len(country)<=8 then
if hour+time>24 then
temp = temp.."\t"..country.."\t\t\t"..os.date(("24"-hour+time)..":".."%M:%S".."\r\n")
else
temp = temp.."\t"..country.."\t\t\t"..os.date(hour+time..":".."%M:%S".."\r\n")
end
end
if string.len(country)>=8 then
if hour+time>24 then
temp = temp.."\t"..country.."\t\t"..os.date("24"-hour+time..":".."%M:%S".."\r\n")
else
temp = temp.."\t"..country.."\t\t"..os.date(hour+time..":".."%M:%S".."\r\n")
end
end
end
user:SendPM(bot,temp)
return 1
end
end
ToArrival = ChatArrival
Done !!
--Timezone script
--Requested by -3sixty-
--By Dessamator
--modded(Cleaning up) by Jiten
--Cmds : !time & !timezone
-- Config --
uTime="12" -- difference between ur time and GMT
bot = frmHub:GetHubBotName() -- ur bot name
--The timezones for each country
tTimeZone = {
["Britain"] = 0,
["Honk Kong"] = 8,
["Sweden"] = 2,
["Finland"] = 3,
["India"] = 3,
["Hub Time"] = uTime,
}
-- Config End--
function ChatArrival(user,data)
local data=string.sub(data,1,-2)
local s,e,cmd = string.find(data,"%b<>%s+(%S+)")
local temp,GMT = "\r\n\t\t".."Timezones: ".."\r\n".."\t".."Country".."\t\t\t".."Time".."\r\n\t"..string.rep("??",16).."\r\n", (os.date("%H")) - uTime
if GMT < 0 then GMT = 24 - uTime + (os.date("%H")) end
if cmd =="!time" then
user:SendData(bot,os.date("The Current time is : %X"))
return 1
elseif cmd=="!timezone" then
for country,time in tTimeZone do
local tab = "\t\t\t"
if string.len(country) >=8 then tab = "\t\t" end
temp = temp.."\t"..country..tab..os.date(GMT+time..":".."%M:%S".."\r\n")
end
user:SendData(bot,temp)
return 1
end
end
ToArrival = ChatArrival
Heya Dessamator. Small fix in the code:
if GMT < 0 then GMT = 24 - uTime - 1 end
to
if GMT < 0 then GMT = 24 - uTime + (os.date("%H")) end
Cheers
QuoteOriginally posted by jiten
Heya Dessamator. Small fix in the code:
if GMT < 0 then GMT = 24 - uTime - 1 end
to
if GMT < 0 then GMT = 24 - uTime + (os.date("%H")) end
Cheers
Done !