X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/36d88e5726e9d7da88fca3efd0d6f824d6254e46..31acfe7a5fe499c1698ae23ada97519b4b262469:/luatz/init.lua?ds=inline diff --git a/luatz/init.lua b/luatz/init.lua index 02b07ba..1a6c835 100644 --- a/luatz/init.lua +++ b/luatz/init.lua @@ -17,10 +17,15 @@ _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 ) +end + --- C-like functions _M.gmtime = function ( ts ) - return _M.timetable.new_from_timestamp ( ts ):normalise ( ) + return _M.timetable.new_from_timestamp ( ts ) end _M.localtime = function ( ts ) @@ -29,7 +34,7 @@ _M.localtime = function ( ts ) end _M.ctime = function ( ts ) - return _M.localtime ( ts ):asctime ( ) + return _M.strftime.asctime ( _M.localtime ( ts ) ) end return _M