X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/559b74f2263f649dab60af846949536cbbb4b10c..bdbbf89c38126a71b17049469e8f976c571b9392:/luatz/init.lua diff --git a/luatz/init.lua b/luatz/init.lua index 1a6c835..4423189 100644 --- a/luatz/init.lua +++ b/luatz/init.lua @@ -1,9 +1,9 @@ local _M = { - gettime = require "luatz.gettime" ; - parse = require "luatz.parse" ; - strftime = require "luatz.strftime" ; - timetable = require "luatz.timetable" ; - tzcache = require "luatz.tzcache" ; + gettime = require "luatz.gettime"; + parse = require "luatz.parse"; + strftime = require "luatz.strftime"; + timetable = require "luatz.timetable"; + tzcache = require "luatz.tzcache"; } --- Top-level aliases for common functions @@ -13,28 +13,28 @@ _M.get_tz = _M.tzcache.get_tz --- Handy functions -_M.time_in = function ( tz , now ) - return _M.get_tz ( tz ):localize ( now ) +_M.time_in = function(tz, now) + return _M.get_tz(tz):localize(now) end -_M.now = function ( ) - local ts = _M.gettime.gettime ( ) - return _M.timetable.new_from_timestamp ( ts ) +_M.now = function() + local ts = _M.gettime.gettime() + return _M.timetable.new_from_timestamp(ts) end --- C-like functions -_M.gmtime = function ( ts ) - return _M.timetable.new_from_timestamp ( ts ) +_M.gmtime = function(ts) + return _M.timetable.new_from_timestamp(ts) end -_M.localtime = function ( ts ) - ts = _M.time_in ( nil , ts ) - return _M.gmtime ( ts ) +_M.localtime = function(ts) + ts = _M.time_in(nil, ts) + return _M.gmtime(ts) end -_M.ctime = function ( ts ) - return _M.strftime.asctime ( _M.localtime ( ts ) ) +_M.ctime = function(ts) + return _M.strftime.asctime(_M.localtime(ts)) end return _M