Changeset

5107:6ac790efecd3

util.datetime: Fix timestamp parsing pattern.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 28 Aug 2012 05:08:18 +0500
parents 5105:50688a2856f7
children 5108:022123451e52 5110:72a7427368f8
files util/datetime.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;