--- a/mod_http_muc_log/mod_http_muc_log.lua Sat Nov 18 13:55:47 2017 +0100
+++ b/mod_http_muc_log/mod_http_muc_log.lua Sat Nov 18 20:38:30 2017 +0100
@@ -65,6 +65,9 @@
local function time(t)
return os_time(t) + t_diff;
end
+local function date_floor(t)
+ return t - t % 86400;
+end
-- Fetch one item
local function find_once(room, query, retval)
@@ -113,7 +116,7 @@
if not when then break; end
local t = os_date("!*t", when);
dates:set(t.year, t.month, t.day, when );
- next_day = when + (86400 - (when % 86400));
+ next_day = date_floor(when) + 86400;
until not next_day;
end