Google time location

This commit is contained in:
yago 2014-11-22 15:59:49 +01:00
parent 1e4d9290eb
commit e7038964d1

View File

@ -67,7 +67,7 @@ function get_time(lat,lng)
-- The local time in the location is: -- The local time in the location is:
-- timestamp + rawOffset + dstOffset -- timestamp + rawOffset + dstOffset
local localTime = timestamp + data.rawOffset + data.dstOffset local localTime = timestamp + data.rawOffset + data.dstOffset
return localTime return localTime, data.timeZoneId
end end
return localTime return localTime
end end
@ -78,12 +78,12 @@ function getformattedLocalTime(area)
end end
lat,lng,acc = get_latlong(area) lat,lng,acc = get_latlong(area)
if lat == nil and lng==nil then if lat == nil and lng == nil then
return "It seems that in '"..area.."' they do not have a concept of time." return 'It seems that in "'..area..'" they do not have a concept of time.'
end end
local localTime = get_time(lat,lng) local localTime, timeZoneId = get_time(lat,lng)
return "The local time in '"..area.."' is: ".. os.date(dateFormat,localTime) return "The local time in "..timeZoneId.." is: ".. os.date(dateFormat,localTime)
end end
function run(msg, matches) function run(msg, matches)