util/datetime.lua

Thu, 27 Nov 2008 03:12:12 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Thu, 27 Nov 2008 03:12:12 +0000
changeset 438
193f9dd64f17
parent 248
8ce9559d501a
child 519
cccd610a0ef9
permissions
-rw-r--r--

Bumper commit for the new modulemanager API \o/ Updates all the modules, though some more changes may be in store.

-- 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;

mercurial