From 7acb229b4a8876ab0b679521afa44fa74d4433dc Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 11 Jul 2020 11:57:50 -0700 Subject: [PATCH] mobile/location-service: stop using broken adjustment function gettimezoneoffset() returns incorrect values when called with a time_t. Since we only accept the value here if it is within 5 minutes of 'now', using the current timezone offset is a fair approximation. Signed-off-by: Dirk Hohndel --- core/gpslocation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp index 2d63b42f5..e7a4b5d8f 100644 --- a/core/gpslocation.cpp +++ b/core/gpslocation.cpp @@ -133,7 +133,7 @@ QString GpsLocation::currentPosition() if (!hasLocationsSource()) return tr("Unknown GPS location (no GPS source)"); if (m_trackers.count()) { - QDateTime lastFixTime = timestampToDateTime(m_trackers.lastKey() - gettimezoneoffset(m_trackers.lastKey())); + QDateTime lastFixTime = timestampToDateTime(m_trackers.lastKey() + gettimezoneoffset()); QDateTime now = QDateTime::currentDateTime(); int delta = lastFixTime.secsTo(now); qDebug() << "lastFixTime" << lastFixTime.toString() << "now" << now.toString() << "delta" << delta;