From dd86939ca26c510ebdfab0a0844a5bea4b8155eb Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Sat, 27 Nov 2010 01:30:56 +0000 Subject: util.datetime: Fix so that the timestamp returned is always in UTC, timezone offsets were going in the wrong direction --- util/datetime.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/datetime.lua') diff --git a/util/datetime.lua b/util/datetime.lua index 76efc21b..301a49a5 100644 --- a/util/datetime.lua +++ b/util/datetime.lua @@ -48,7 +48,7 @@ function parse(s) tzd_offset = h * 60 * 60 + m * 60; if sign == "-" then tzd_offset = -tzd_offset; end end - sec = sec + time_offset + tzd_offset; + sec = (sec + time_offset) - tzd_offset; return os_time({year=year, month=month, day=day, hour=hour, min=min, sec=sec}); end end -- cgit v1.2.3