Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.7.4
-
None
-
OpenSUSE Linux 11.4, both x86 and x86_64. Qt packages from the "KDE:Qt" repository (http://download.opensuse.org/repositories/KDE:/Qt/openSUSE_11.4).
Description
This test program:
#include <QDateTime> #include <QDebug> int main(int argc, char *argv[]) { QDateTime time1(QDate(2011, 10, 30), QTime(1, 0)); QDateTime time2 = time1.addSecs(3600 * 2); QDateTime time3(QDate(2011, 10, 30), QTime(2, 0)); qDebug() << "time2:" << time2 << " msecs:" << time2.toMSecsSinceEpoch(); qDebug() << "time3:" << time3 << " msecs:" << time3.toMSecsSinceEpoch(); time2 = time1.addSecs(3600); qDebug() << "time2:" << time2 << " msecs:" << time2.toMSecsSinceEpoch(); qDebug() << "time3:" << time3 << " msecs:" << time3.toMSecsSinceEpoch(); return 0; }
produces the following output:
time2: QDateTime("Sun Oct 30 02:00:00 2011") msecs: 1319936400000 time3: QDateTime("Sun Oct 30 02:00:00 2011") msecs: 1319936400000 time2: QDateTime("Sun Oct 30 02:00:00 2011") msecs: 1319932800000 time3: QDateTime("Sun Oct 30 02:00:00 2011") msecs: 1319932800000
After setting the value of time2 the output for time3 changes as well.
My location is Berlin, Germany. On 2011-10-30 the time was shifted back from DST to standard time (CEST -> CET). The hour between 02:00 and 03:00 was thus repeated.