aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2011-01-29 04:42:05 +0500
committerWaqas Hussain <waqas20@gmail.com>2011-01-29 04:42:05 +0500
commitbd95b3ba7be4490956e242753869d969f08504c6 (patch)
treea581020c05cea3cac512b41818d1a56d62dda9c4
parent30be4fa5853c460d6d83d4b55d2d753fe35015bd (diff)
downloadprosody-bd95b3ba7be4490956e242753869d969f08504c6.tar.gz
prosody-bd95b3ba7be4490956e242753869d969f08504c6.zip
mod_ping: Use util.datetime to generate timestamp in ad-hoc command response (instead of the current use of os.date, which doesn't take timezone into account).
-rw-r--r--plugins/mod_ping.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_ping.lua b/plugins/mod_ping.lua
index c0ba6189..0bfcac66 100644
--- a/plugins/mod_ping.lua
+++ b/plugins/mod_ping.lua
@@ -22,8 +22,10 @@ module:hook("iq/host/urn:xmpp:ping:ping", ping_handler);
-- Ad-hoc command
+local datetime = require "util.datetime".datetime;
+
function ping_command_handler (self, data, state)
- local now = os.date("%Y-%m-%dT%X");
+ local now = datetime();
return { info = "Pong\n"..now, status = "completed" };
end