aboutsummaryrefslogtreecommitdiffstats
path: root/util/datetime.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-11-27 01:30:56 +0000
committerMatthew Wild <mwild1@gmail.com>2010-11-27 01:30:56 +0000
commitdd86939ca26c510ebdfab0a0844a5bea4b8155eb (patch)
tree10fe2b8133fd8ec200bfb69e0128230b39d0802b /util/datetime.lua
parent85d3f7707ead334c38173e86e4267ef23e880666 (diff)
downloadprosody-dd86939ca26c510ebdfab0a0844a5bea4b8155eb.tar.gz
prosody-dd86939ca26c510ebdfab0a0844a5bea4b8155eb.zip
util.datetime: Fix so that the timestamp returned is always in UTC, timezone offsets were going in the wrong direction
Diffstat (limited to 'util/datetime.lua')
-rw-r--r--util/datetime.lua2
1 files changed, 1 insertions, 1 deletions
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