util.datetime: Fix timestamp parsing pattern.
authorWaqas Hussain <waqas20@gmail.com>
Tue, 28 Aug 2012 00:08:18 +0000 (05:08 +0500)
committerWaqas Hussain <waqas20@gmail.com>
Tue, 28 Aug 2012 00:08:18 +0000 (05:08 +0500)
util/datetime.lua

index c73d8e761a3c86db120119f7670082ec487f82be..a1f62a48563ed48fc2d30c5c1f5e8b94c66e0e17 100644 (file)
@@ -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;