summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qdatetime.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 935fd65ae1..42721c018f 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2765,9 +2765,6 @@ void QDateTimePrivate::refreshDateTime()
}
// We have a valid date and time and a Qt::LocalTime or Qt::TimeZone that needs calculating
- QDate date;
- QTime time;
- getDateTime(&date, &time);
// LocalTime and TimeZone might fall into "missing" DaylightTime transition hour
// Calling toEpochMSecs will adjust the returned date/time if it does
QDate testDate;
@@ -2781,7 +2778,7 @@ void QDateTimePrivate::refreshDateTime()
epochMSecs = zoneMSecsToEpochMSecs(m_msecs, m_timeZone, &testDate, &testTime);
#endif // QT_BOOTSTRAPPED
}
- if (testDate == date && testTime == time) {
+ if (timeToMSecs(testDate, testTime) == m_msecs) {
setValidDateTime();
// Cache the offset to use in toMSecsSinceEpoch()
m_offsetFromUtc = (m_msecs - epochMSecs) / 1000;