# HG changeset patch # User Kim Alvefur # Date 1415627496 -3600 # Node ID c357039c1ab1a2af9ecf82c5b6b2a2b408f9a2e6 # Parent 585bb8ac11bb7f49c918ded64a65f45667f540a0 mod_storage_muc_log: Change to sane timestamp format and warn if it differs from legacy mod_muc_log timestamps diff -r 585bb8ac11bb -r c357039c1ab1 mod_storage_muc_log/mod_storage_muc_log.lua --- a/mod_storage_muc_log/mod_storage_muc_log.lua Mon Nov 10 14:47:54 2014 +0100 +++ b/mod_storage_muc_log/mod_storage_muc_log.lua Mon Nov 10 14:51:36 2014 +0100 @@ -8,7 +8,7 @@ local noop = function () end; local os_date = os.date; -local timef, datef = "!%X", "!%y%m%d"; +local timef, datef = "!%H:%M:%S", "!%y%m%d"; local host = module.host; local driver = {}; @@ -19,12 +19,15 @@ -- Fun fact: 09:00 and 21:00 en_HK are both "09:00:00 UTC" local t = os_date("!*t"); t.hour = 9; - local am = os_date(timef, os.time(t)); + local am = os_date("!%X", os.time(t)); t.hour = 21; - local pm = os_date(timef, os.time(t)); + local pm = os_date("!%X", os.time(t)); if am == pm then module:log("warn", "Timestamps in AM and PM are identical in your locale, expect timestamps to be wrong"); end + if os_date("!%X", os.time(t)) ~= os_date(timef, os_date(t)) then + module:log("warn", "Timestamp format differ from what mod_muc_log used, this module may not work correctly"); + end end local function parse_silly(date, time)