X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/a809e6fc8a079b8db520aebdb5567d7cf55c1559..bab202dc11e948f75e617b39024dc67f9a11691f:/src/timetable.lua diff --git a/src/timetable.lua b/src/timetable.lua index 882d8fd..1ce701c 100644 --- a/src/timetable.lua +++ b/src/timetable.lua @@ -1,3 +1,4 @@ +local strformat = string.format local floor = math.floor local function idiv ( n , d ) return floor ( n / d ) @@ -173,12 +174,17 @@ local function new_timetable ( year , month , day , hour , min , sec ) } end +local function new_from_timestamp ( ts ) + return new_timetable ( 1970 , 1 , 1 , 0 , 0 , ts ) +end + return { doomsday = doomsday ; normalise = normalise ; timestamp = timestamp ; new = new_timetable ; + new_from_timestamp = new_from_timestamp ; cast = cast_timetable ; timetable_mt = timetable_mt ; }