aboutsummaryrefslogtreecommitdiffstats
path: root/util/datetime.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2008-11-15 13:47:17 +0100
committerTobias Markmann <tm@ayena.de>2008-11-15 13:47:17 +0100
commitefb34b5c4af68c37a568e61986a0b93535a50814 (patch)
treeba77cb7ad14158323a31bfb9e332c508e94d5b31 /util/datetime.lua
parent18e785078a2edf69bf4ec728290a18de2ed28cd7 (diff)
parentaefcb845c34c7bf15a370812b28b5da27fbc983b (diff)
downloadprosody-efb34b5c4af68c37a568e61986a0b93535a50814.tar.gz
prosody-efb34b5c4af68c37a568e61986a0b93535a50814.zip
Merging my new SASL code with Waqas' adjusted saslauth module.
Diffstat (limited to 'util/datetime.lua')
-rw-r--r--util/datetime.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/util/datetime.lua b/util/datetime.lua
new file mode 100644
index 00000000..077cbb67
--- /dev/null
+++ b/util/datetime.lua
@@ -0,0 +1,28 @@
+-- XEP-0082: XMPP Date and Time Profiles
+
+local os_date = os.date;
+local error = error;
+
+module "datetime"
+
+function date()
+ return os_date("!%Y-%m-%d");
+end
+
+function datetime()
+ return os_date("!%Y-%m-%dT%H:%M:%SZ");
+end
+
+function time()
+ return os_date("!%H:%M:%S");
+end
+
+function legacy()
+ return os_date("!%Y%m%dT%H:%M:%S");
+end
+
+function parse(s)
+ error("datetime.parse: Not implemented"); -- TODO
+end
+
+return _M;