aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-12-09 23:06:02 +0100
committerKim Alvefur <zash@zash.se>2018-12-09 23:06:02 +0100
commitd8f36fc7e8430aec376267b5f57dc1064dc48c9e (patch)
tree5b686fc183eb5235f56bb98f2a13ea0533d3c0f2 /util
parent619990cf1f9ce75c60252b54da31ba7597fe57b8 (diff)
parent968eaf41a85439c6f13a0dffab06ed79fec87f41 (diff)
downloadprosody-d8f36fc7e8430aec376267b5f57dc1064dc48c9e.tar.gz
prosody-d8f36fc7e8430aec376267b5f57dc1064dc48c9e.zip
Merge 0.11->trunk
Diffstat (limited to 'util')
-rw-r--r--util/datetime.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/datetime.lua b/util/datetime.lua
index 06be9fc2..2d27ece4 100644
--- a/util/datetime.lua
+++ b/util/datetime.lua
@@ -38,7 +38,8 @@ local function parse(s)
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+%-]?.*)$");
if year then
- local time_offset = os_difftime(os_time(os_date("*t")), os_time(os_date("!*t"))); -- to deal with local timezone
+ local now = os_time();
+ local time_offset = os_difftime(os_time(os_date("*t", now)), os_time(os_date("!*t", now))); -- to deal with local timezone
local tzd_offset = 0;
if tzd ~= "" and tzd ~= "Z" then
local sign, h, m = tzd:match("([+%-])(%d%d):?(%d*)");