diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 4854ceb5ca..0c4b47d36e 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -2236,18 +2236,18 @@ static qint64 qt_mktime(QDate *date, QTime *time, QDateTimePrivate::DaylightStat #else // All other platforms provide standard C library time functions tm local; + memset(&local, 0, sizeof(local)); // tm_[wy]day plus any non-standard fields local.tm_sec = time->second(); local.tm_min = time->minute(); local.tm_hour = time->hour(); local.tm_mday = dd; local.tm_mon = mm - 1; local.tm_year = yy - 1900; - local.tm_wday = 0; - local.tm_yday = 0; if (daylightStatus) local.tm_isdst = int(*daylightStatus); else local.tm_isdst = -1; + #if defined(Q_OS_WIN) int hh = local.tm_hour; #endif // Q_OS_WIN