X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=util%2Fdatetime.lua;h=a1f62a48563ed48fc2d30c5c1f5e8b94c66e0e17;hb=4b39eb72b97e9827e5322974f0424c3fc063ce25;hp=c73d8e761a3c86db120119f7670082ec487f82be;hpb=901108e66f1099428a9d34d83f19130029e1220d;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;