From 3abaaf68b0945784e3a8968a733bd7f569e4330e Mon Sep 17 00:00:00 2001 From: daurnimator Date: Wed, 24 Jul 2013 11:56:07 -0400 Subject: [PATCH] src/timetable: Add new_from_timestamp function --- src/timetable.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/timetable.lua b/src/timetable.lua index 882d8fd..887ee94 100644 --- a/src/timetable.lua +++ b/src/timetable.lua @@ -173,12 +173,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 ; } -- 2.39.5