diff --git a/src/corelib/time/qdatetime.h b/src/corelib/time/qdatetime.h index 70a79a4f874..77247dcd078 100644 --- a/src/corelib/time/qdatetime.h +++ b/src/corelib/time/qdatetime.h @@ -543,10 +543,9 @@ public: >; } { - const auto sysTime = std::chrono::clock_cast(time); - // clock_cast can change the duration, so convert it again to milliseconds - const auto timeInMSec = std::chrono::time_point_cast(sysTime); - return fromStdTimePoint(timeInMSec); + using namespace std::chrono; + const sys_time sysTime = clock_cast(time); + return fromStdTimePoint(sysTime); } #endif // __cpp_concepts