X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;ds=sidebyside;f=util%2Fdatetime.lua;h=a1f62a48563ed48fc2d30c5c1f5e8b94c66e0e17;hb=082e265af83ea25d8203d12114c6cf1b5cef810a;hp=c73d8e761a3c86db120119f7670082ec487f82be;hpb=8ee0370603ca03f15e7d3ea7242c6f1d9b9ef3a0;p=prosody.git diff --git a/util/datetime.lua b/util/datetime.lua index c73d8e76..a1f62a48 100644 --- a/util/datetime.lua +++ b/util/datetime.lua @@ -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;