X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fdatetime.lua;h=cf00e4c320323a03d137742bb2dd0fd5143df2a2;hb=3813f633eebc075fc0cf3db4c7da4f24f49e5bc0;hp=077cbb67fb294ab9ac5bdf7704fd6104e98821f9;hpb=d97ffa03be427c8f4428755fd76edc40b50a8682;p=prosody.git diff --git a/util/datetime.lua b/util/datetime.lua index 077cbb67..cf00e4c3 100644 --- a/util/datetime.lua +++ b/util/datetime.lua @@ -1,28 +1,37 @@ --- 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; +-- Prosody IM +-- Copyright (C) 2008-2010 Matthew Wild +-- Copyright (C) 2008-2010 Waqas Hussain +-- +-- This project is MIT/X11 licensed. Please see the +-- COPYING file in the source package for more information. +-- + + +-- XEP-0082: XMPP Date and Time Profiles + +local os_date = os.date; +local error = error; + +module "datetime" + +function date(t) + return os_date("!%Y-%m-%d", t); +end + +function datetime(t) + return os_date("!%Y-%m-%dT%H:%M:%SZ", t); +end + +function time(t) + return os_date("!%H:%M:%S", t); +end + +function legacy(t) + return os_date("!%Y%m%dT%H:%M:%S", t); +end + +function parse(s) + error("datetime.parse: Not implemented"); -- TODO +end + +return _M;