diff options
Diffstat (limited to 'src/corelib/global/qtenvironmentvariables.cpp')
-rw-r--r-- | src/corelib/global/qtenvironmentvariables.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/global/qtenvironmentvariables.cpp b/src/corelib/global/qtenvironmentvariables.cpp index 47fc8f7eec..cf5955902a 100644 --- a/src/corelib/global/qtenvironmentvariables.cpp +++ b/src/corelib/global/qtenvironmentvariables.cpp @@ -353,6 +353,10 @@ void qTzSet() time_t qMkTime(struct tm *when) { const auto locker = qt_scoped_lock(environmentMutex); +#if defined(Q_OS_WIN) + // QTBUG-83881 MS's mktime() seems to need _tzset() called first. + _tzset(); +#endif return mktime(when); } @@ -404,7 +408,7 @@ QString qTzName(int dstIndex) { char name[512]; bool ok; -#if defined(Q_CC_MSVC) +#if defined(_UCRT) // i.e., MSVC and MinGW-UCRT size_t s = 0; { const auto locker = qt_scoped_lock(environmentMutex); |