# HG changeset patch # User Matthew Wild # Date 1290821456 0 # Node ID 2dc342a13f35f6775f04c41867f9cb8a670c58a8 # Parent ed80c4c56b9c31d8ffba1a6e2cfad05ea3d9dd9c util.datetime: Fix so that the timestamp returned is always in UTC, timezone offsets were going in the wrong direction diff -r ed80c4c56b9c -r 2dc342a13f35 util/datetime.lua --- a/util/datetime.lua Sat Nov 27 01:22:43 2010 +0000 +++ b/util/datetime.lua Sat Nov 27 01:30:56 2010 +0000 @@ -48,7 +48,7 @@ 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