aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2012-08-28 05:08:18 +0500
committerWaqas Hussain <waqas20@gmail.com>2012-08-28 05:08:18 +0500
commit8df019952cf1e5d32832af1a8bf007d4408c2864 (patch)
tree2b0e3402405ffcfc7fc7b08123eb305ff46c088a
parentc6ddf7f4ee8c5ab170f454c1b57b708897c79d2e (diff)
downloadprosody-8df019952cf1e5d32832af1a8bf007d4408c2864.tar.gz
prosody-8df019952cf1e5d32832af1a8bf007d4408c2864.zip
util.datetime: Fix timestamp parsing pattern.
-rw-r--r--util/datetime.lua2
1 files changed, 1 insertions, 1 deletions
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;