Mercurial > prosody-modules
diff mod_audit/mod_audit.lua @ 5761:754f8eaad34c
mod_audit: Fix error due to sub-second precision timestamps
os.date() does not handle them
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 02 Dec 2023 12:30:28 +0100 |
parents | 08a635862201 |
children | 6c0570a8b866 |
line wrap: on
line diff
--- a/mod_audit/mod_audit.lua Sat Dec 02 12:23:15 2023 +0100 +++ b/mod_audit/mod_audit.lua Sat Dec 02 12:30:28 2023 +0100 @@ -221,7 +221,7 @@ end local colspec = { - { title = "Date", key = "when", width = 19, mapper = function (when) return os.date("%Y-%m-%d %R:%S", when); end }; + { title = "Date", key = "when", width = 19, mapper = function (when) return os.date("%Y-%m-%d %R:%S", math.floor(when)); end }; { title = "Source", key = "source", width = "2p" }; { title = "Event", key = "event_type", width = "2p" }; };