X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fdatetime.lua;h=dd596527c4325c050d4d7c11eedb602cb3f272d3;hb=95dfe4b0aaaf26ee4651c09eb9757c56210a135a;hp=c73d8e761a3c86db120119f7670082ec487f82be;hpb=8ee0370603ca03f15e7d3ea7242c6f1d9b9ef3a0;p=prosody.git diff --git a/util/datetime.lua b/util/datetime.lua index c73d8e76..dd596527 100644 --- a/util/datetime.lua +++ b/util/datetime.lua @@ -1,7 +1,7 @@ -- 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. -- @@ -36,7 +36,7 @@ end function parse(s) if s then local year, month, day, hour, min, sec, tzd; - year, month, day, hour, min, sec, tzd = s:match("^(%d%d%d%d)-?(%d%d)-?(%d%d)T(%d%d):(%d%d):(%d%d)%.?%d*([Z+%-].*)$"); + year, month, day, hour, min, sec, tzd = s:match("^(%d%d%d%d)%-?(%d%d)%-?(%d%d)T(%d%d):(%d%d):(%d%d)%.?%d*([Z+%-]?.*)$"); if year then local time_offset = os_difftime(os_time(os_date("*t")), os_time(os_date("!*t"))); -- to deal with local timezone local tzd_offset = 0;