X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/3986096b79163d8e13a64730b10ba1e9783ccd81..f7e8c83697ed526ddd93763dfde409c6d2c6391d:/luatz/tzinfo.lua?ds=sidebyside diff --git a/luatz/tzinfo.lua b/luatz/tzinfo.lua index adaf173..3ff0a07 100644 --- a/luatz/tzinfo.lua +++ b/luatz/tzinfo.lua @@ -2,18 +2,20 @@ local gettime = require "luatz.gettime".gettime local timetable_mt = require "luatz.timetable".timetable_mt local function to_timestamp ( o ) - if type ( ts_local ) == "number" then - return ts_local + if type ( o ) == "number" then + return o elseif getmetatable ( o ) == timetable_mt then - return ts_local:timestamp ( ) + return o:timestamp ( ) end end local tz_info_methods = { } local tz_info_mt = { + __name = "luatz.tz_info"; __index = tz_info_methods ; } local tt_info_mt = { + __name = "luatz.tt_info"; __tostring = function ( self ) return string.format ( "tt_info:%s=%d" , self.abbr , self.gmtoff ) end ;