diff util/datetime.lua @ 282:80e7de32b618

Merging my new SASL code with Waqas' adjusted saslauth module.
author Tobias Markmann <tm@ayena.de>
date Sat, 15 Nov 2008 13:47:17 +0100
parents 8ce9559d501a
children cccd610a0ef9
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/util/datetime.lua	Sat Nov 15 13:47:17 2008 +0100
@@ -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;