mod_time: Return sub-second precision timestamps
authorKim Alvefur <zash@zash.se>
Sun, 14 Aug 2022 17:47:13 +0200
changeset 12636 70ae68bb0aa5
parent 12635 9524bb7f3944
child 12637 5d8b0e0b9d48
mod_time: Return sub-second precision timestamps Because why not? Who even has this module enabled?
plugins/mod_time.lua
--- a/plugins/mod_time.lua	Sun Aug 14 17:29:39 2022 +0200
+++ b/plugins/mod_time.lua	Sun Aug 14 17:47:13 2022 +0200
@@ -8,6 +8,7 @@
 
 local st = require "util.stanza";
 local datetime = require "util.datetime".datetime;
+local now = require "util.time".now;
 local legacy = require "util.datetime".legacy;
 
 -- XEP-0202: Entity Time
@@ -18,7 +19,7 @@
 	local origin, stanza = event.origin, event.stanza;
 	origin.send(st.reply(stanza):tag("time", {xmlns="urn:xmpp:time"})
 		:tag("tzo"):text("+00:00"):up() -- TODO get the timezone in a platform independent fashion
-		:tag("utc"):text(datetime()));
+		:tag("utc"):text(datetime(now())));
 	return true;
 end