From 4e70f0f5f8d149c4a189e43cd0b5acfb23b40500 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Mon, 16 Dec 2019 11:16:26 +0100 Subject: [PATCH] build with older Qt --- libnymea-core/jsonrpc/systemhandler.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libnymea-core/jsonrpc/systemhandler.cpp b/libnymea-core/jsonrpc/systemhandler.cpp index b990ec1d..7ff8ad3a 100644 --- a/libnymea-core/jsonrpc/systemhandler.cpp +++ b/libnymea-core/jsonrpc/systemhandler.cpp @@ -252,7 +252,7 @@ SystemHandler::SystemHandler(Platform *platform, QObject *parent): }); connect(m_platform->systemController(), &PlatformSystemController::timeConfigurationChanged, this, [this](){ QVariantMap params; - params.insert("time", QDateTime::currentDateTime().toSecsSinceEpoch()); + params.insert("time", QDateTime::currentDateTime().toMSecsSinceEpoch() / 1000); params.insert("timeZone", QTimeZone::systemTimeZoneId()); params.insert("automaticTimeAvailable", m_platform->systemController()->automaticTimeAvailable()); params.insert("automaticTime", m_platform->systemController()->automaticTime()); @@ -374,7 +374,7 @@ JsonReply *SystemHandler::GetTime(const QVariantMap ¶ms) const QVariantMap returns; returns.insert("automaticTimeAvailable", m_platform->systemController()->automaticTimeAvailable()); returns.insert("automaticTime", m_platform->systemController()->automaticTime()); - returns.insert("time", QDateTime::currentDateTime().toSecsSinceEpoch()); + returns.insert("time", QDateTime::currentDateTime().toMSecsSinceEpoch() / 1000); returns.insert("timeZone", QTimeZone::systemTimeZoneId()); return createReply(returns); } @@ -392,7 +392,7 @@ JsonReply *SystemHandler::SetTime(const QVariantMap ¶ms) const handled = true; } if (!automaticTime && params.contains("time")) { - QDateTime time = QDateTime::fromSecsSinceEpoch(params.value("time").toUInt()); + QDateTime time = QDateTime::fromMSecsSinceEpoch(params.value("time").toLongLong() * 1000); if (!m_platform->systemController()->setTime(time)) { returns.insert("success", false); return createReply(returns);