Software /
code /
prosody
Diff
plugins/mod_time.lua @ 12632:70ae68bb0aa5
mod_time: Return sub-second precision timestamps
Because why not? Who even has this module enabled?
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 14 Aug 2022 17:47:13 +0200 |
parent | 9225:0ba963e82ac7 |
child | 12635:f928cb5c5d04 |
line wrap: on
line diff
--- 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