summaryrefslogtreecommitdiff
path: root/saltoqd/systemmanager.cpp
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2015-03-29 05:29:49 +0200
committerJavier <dev.git@javispedro.com>2015-03-29 05:29:49 +0200
commit88a96091042c63d9b2d62dedb3a7b9be0f53bf49 (patch)
tree138b22db78323ee3887dc213059cc8dca56814db /saltoqd/systemmanager.cpp
parent4b508d6344f76ce69055ee8eb79bf43cc89ad69c (diff)
downloadsaltoq-88a96091042c63d9b2d62dedb3a7b9be0f53bf49.tar.gz
saltoq-88a96091042c63d9b2d62dedb3a7b9be0f53bf49.zip
load address from settings
Diffstat (limited to 'saltoqd/systemmanager.cpp')
-rw-r--r--saltoqd/systemmanager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/saltoqd/systemmanager.cpp b/saltoqd/systemmanager.cpp
index ac0c5b5..bd5a563 100644
--- a/saltoqd/systemmanager.cpp
+++ b/saltoqd/systemmanager.cpp
@@ -34,8 +34,12 @@ void SystemManager::handleGetTimeMessage(const ToqConnection::Message &msg)
time(&now);
localtime_r(&now, &now_info);
+ int offset = now_info.tm_gmtoff;
+ // Seems that the watch manually adds 1h if we are on DST.
+ if (now_info.tm_isdst) offset -= 3600;
+
detail.insert("epoch_time", qint64(now));
- detail.insert("time_zone", int(now_info.tm_gmtoff));
+ detail.insert("time_zone", offset);
detail.insert("dst", int(now_info.tm_isdst));
reply.insert("result", int(0));