Software /
code /
prosody
File
util/datetime.lua @ 402:50f1c09541cd
Checking some variables for nil so no errors occur that'll break the server.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Sun, 23 Nov 2008 20:43:42 +0100 |
parent | 248:8ce9559d501a |
child | 519:cccd610a0ef9 |
line wrap: on
line source
-- 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;