From 4de0b20d3772147ee340250637ce225e215efba5 Mon Sep 17 00:00:00 2001 From: ollo Date: Sun, 15 May 2016 17:31:22 +0200 Subject: [PATCH] Added new function returing the current time for a given timezone also handling the summer and winter time --- timecore.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/timecore.lua b/timecore.lua index 0bdec66..0e555e2 100644 --- a/timecore.lua +++ b/timecore.lua @@ -131,3 +131,10 @@ function getUTCtime(unixtimestmp) end +function getTime(unixtimestmp, timezoneoffset) + time = getUTCtime(unixtimestmp + (3600 * timezoneoffset)) + if ( isSummerTime(time) ) then + time = getUTCtime(unixtimestmp + (3600 * (timezoneoffset + 1)) ) + end + return time +end