On macOS, create a QDateTime object like this:
In debug mode, it'll assert here: qtimezoneprivate.cpp line 329.
This is because the QMacTimeZonePrivate::previousTransition function returns a invalid QTimeZonePrivate::Data structure when "forLocalMSecs" is equal to zero (which it will be when the date and time portion of the QDateTime are invalid).
The output on assert is this
To reproduce it requires debug version of the frameworks? In QtCreator, check-off the "Use debug version of the frameworks".
The function where the assert happens, you can see that it easily handles the fallback situation where the values are invalid. The assert is needless and roadblocks a developers who actual do run into situations were the QDateTime object is instantiated with invalid
date/times but a valid timezone. Instead of an assert, use qWarning(), or even qCritical() if you must. There is no need to force an application abort in this case.