diff options
Diffstat (limited to 'saltoqd/systemmanager.cpp')
-rw-r--r-- | saltoqd/systemmanager.cpp | 6 |
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)); |