mod_audit: Fix error due to sub-second precision timestamps
authorKim Alvefur <zash@zash.se>
Sat, 02 Dec 2023 12:30:28 +0100
changeset 5765 754f8eaad34c
parent 5764 59e38aaa3ec1
child 5766 ff8b6d0b3bfa
mod_audit: Fix error due to sub-second precision timestamps os.date() does not handle them
mod_audit/mod_audit.lua
--- 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" };
 	};