# HG changeset patch # User Waqas Hussain # Date 1346112498 -18000 # Node ID 6ac790efecd369f611a5c7cb79f19b5fc6a9f985 # Parent 50688a2856f7922664b6ec2ad64ac91aebd78e3f util.datetime: Fix timestamp parsing pattern. diff -r 50688a2856f7 -r 6ac790efecd3 util/datetime.lua --- a/util/datetime.lua Sun Aug 26 22:54:10 2012 +0000 +++ b/util/datetime.lua Tue Aug 28 05:08:18 2012 +0500 @@ -36,7 +36,7 @@ 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;