aboutsummaryrefslogtreecommitdiffstats
path: root/util/datetime.lua
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
commitf79f756a448351c3b4d9250f8c6247d1c0cfa629 (patch)
tree2b0e3402405ffcfc7fc7b08123eb305ff46c088a /util/datetime.lua
parentd4e080f745645d308e0eeb9cfd6386313a45617e (diff)
downloadprosody-f79f756a448351c3b4d9250f8c6247d1c0cfa629.tar.gz
prosody-f79f756a448351c3b4d9250f8c6247d1c0cfa629.zip
util.datetime: Fix timestamp parsing pattern.
Diffstat (limited to 'util/datetime.lua')
-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;