changeset 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 59e38aaa3ec1
children ff8b6d0b3bfa
files mod_audit/mod_audit.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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" };
 	};