Created
July 15, 2009 22:09
-
-
Save airtonix/148028 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do | |
local HOUR = 60*60 | |
local zones = { | |
{ "EDT", HOUR * 13.5 }, | |
{ "CDT", HOUR * 14.5}, | |
{ "MDT", HOUR * 15.5}, | |
{ "PDT", HOUR * 16.5}, | |
{ "PST", HOUR * 17.5}, | |
{ "AKDT", HOUR * 18.5}, | |
{ "HAST", HOUR * 19.5}, | |
} | |
local pad = function(s, width, padder) | |
padder = string.rep(padder or " ", math.abs(width)) | |
if width < 0 then return string.strsub(padder .. s, width) end | |
return string.sub(s .. padder, 1, width) | |
end | |
local tinsert = table.insert | |
function conky_time_zones(arg) | |
local output = {} | |
local time | |
for index,timezone in pairs(zones)do | |
tinsert(output,os.date(pad(timezone[1], 4, " ").." %a %d %b ${color1}%H:%M${color5}%p",os.time()-timezone[2]) ) | |
end | |
return table.concat(output,"\n") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment