aboutsummaryrefslogtreecommitdiffstats
path: root/util/datetime.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-11-13 16:58:29 +0000
committerMatthew Wild <mwild1@gmail.com>2008-11-13 16:58:29 +0000
commit11ec0f82d756ef0a7d4bcd56151367126b3a20bf (patch)
tree98b20c6ccab370f68dbddeceb22dfd5e62ff67b1 /util/datetime.lua
parent22926813345e5f0046b846cd7817e9483ad4c8e6 (diff)
parenta1740642f2a9af6bf42747fe0b4bf2148fc38449 (diff)
downloadprosody-11ec0f82d756ef0a7d4bcd56151367126b3a20bf.tar.gz
prosody-11ec0f82d756ef0a7d4bcd56151367126b3a20bf.zip
Merge from waqas
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;