Index: sources/view/settings/VDateTime.cpp =================================================================== diff -u -r5b9ecb01e9dca6c67f8ecf66fa0c63ac34c820d9 -r927113ed8827c44bbe40e0af952ac9b9683ac03b --- sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 5b9ecb01e9dca6c67f8ecf66fa0c63ac34c820d9) +++ sources/view/settings/VDateTime.cpp (.../VDateTime.cpp) (revision 927113ed8827c44bbe40e0af952ac9b9683ac03b) @@ -91,22 +91,21 @@ hour ( vHour ); minute ( vMinute ); - QDateTime currentDateTimeLocal ( QDate(_year .toInt() , - _month .toInt() , - _day .toInt()), - QTime(_hour .toInt() , - _minute .toInt())); + const QDateTime currentDateTimeLocal ( QDate(_year .toInt() , + _month .toInt() , + _day .toInt()) , + QTime(_hour .toInt() , + _minute .toInt())); const QString dateTimeLocalStr = currentDateTimeLocal.toString(_Settings.getDatetimeFormat()); // Get the current UTC datetime - QDateTime currentDateTimeUTC = currentDateTimeLocal.toUTC(); - currentDateTimeUTC.setTimeSpec(Qt::UTC); - const quint32 epochUTC_sec = currentDateTimeUTC.toSecsSinceEpoch(); + const QDateTime currentDateTimeUTC = currentDateTimeLocal.toUTC(); + const quint32 epochUTC_sec = currentDateTimeUTC.toSecsSinceEpoch(); LOG_DEBUG(tr("SetDateTime %1").arg(dateTimeLocalStr)); status("Setting date and time ..."); - dateTimeUI(dateTimeLocalStr); + dateTimeUI(dateTimeLocalStr ); dateTimeHD(epochUTC_sec ); dateTimeDG(epochUTC_sec ); @@ -273,16 +272,14 @@ // Doing a single update of the HD-UI RTC sync on start-up static bool _hasDoneHDSyncRTC = false; if ( !_hasDoneHDSyncRTC ) { - QDateTime hdRTCTime; - hdRTCTime.setTimeSpec(Qt::UTC); - hdRTCTime.setSecsSinceEpoch(vData.mEpoch); + QDateTime hdRTCTime_localZone; // Default timespec is Qt::localTime / local time zoned + hdRTCTime_localZone.setSecsSinceEpoch(vData.mEpoch); - QDateTime localDateTime = hdRTCTime.toLocalTime(); - - QString newDateTimeString = localDateTime.toString(_Settings.getDatetimeFormat()); + const QString newDateTimeString = hdRTCTime_localZone.toString(_Settings.getDatetimeFormat()); dateTimeUI(newDateTimeString); + _hasDoneHDSyncRTC = true; // indicate HD-UI RTC sync'd - //DEBUG: qDebug() << "Sync HD->UI RTC | HD Epoch: " << vData.mEpoch << " | HD datetime: " << hdRTCTime.toString(_Settings.getDatetimeFormat()) <<" | local datetime : " << newDateTimeString; + //DEBUG: qDebug() << "Sync HD->UI RTC | HD Epoch: " << vData.mEpoch << " | HD datetime (local zone): " << hdRTCTime_localZone.toString(_Settings.getDatetimeFormat()) <<" | local datetime : " << newDateTimeString; } }