diff --git a/src/corelib/time/qdatetime.h b/src/corelib/time/qdatetime.h index da7a28af3cb..240fcc06328 100644 --- a/src/corelib/time/qdatetime.h +++ b/src/corelib/time/qdatetime.h @@ -458,7 +458,7 @@ public: return result.addMSecs(time.time_since_epoch().count()); } -#if QT_CONFIG(timezone) +#if QT_CONFIG(timezone) && (__cpp_lib_chrono >= 201907L || defined(Q_QDOC)) // zoned_time. defined in qtimezone.h QT_POST_CXX17_API_IN_EXPORTED_CLASS static QDateTime fromStdZonedTime(const std::chrono::zoned_time< diff --git a/src/corelib/time/qtimezone.h b/src/corelib/time/qtimezone.h index 6e7ee0bb026..4006e673e76 100644 --- a/src/corelib/time/qtimezone.h +++ b/src/corelib/time/qtimezone.h @@ -256,7 +256,7 @@ Q_CORE_EXPORT QDataStream &operator>>(QDataStream &ds, QTimeZone &tz); Q_CORE_EXPORT QDebug operator<<(QDebug dbg, const QTimeZone &tz); #endif -#if __cpp_lib_chrono >= 201907L +#if QT_CONFIG(timezone) && __cpp_lib_chrono >= 201907L // zoned_time template // QT_POST_CXX17_API_IN_EXPORTED_CLASS inline QDateTime QDateTime::fromStdZonedTime(const std::chrono::zoned_time<