diff options
author | Waqas Hussain <waqas20@gmail.com> | 2008-11-13 12:12:19 +0500 |
---|---|---|
committer | Waqas Hussain <waqas20@gmail.com> | 2008-11-13 12:12:19 +0500 |
commit | 5358129300fc848b130811999adb945773f171fb (patch) | |
tree | 9297187a7632232aeeacaf6f7fcda851ae2bd2a2 /util | |
parent | 6c0003661af9cee25d27dcee5b7cd4520c105cdd (diff) | |
download | prosody-5358129300fc848b130811999adb945773f171fb.tar.gz prosody-5358129300fc848b130811999adb945773f171fb.zip |
Added util.datetime: Utility methods to support XEP-0082: XMPP Date and Time Profiles
Diffstat (limited to 'util')
-rw-r--r-- | util/datetime.lua | 28 |
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;
|