Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-59061

QDateTime::addDays() does not work properly with UTC

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.9.0 Beta 2
    • 5.8.0
    • Core: Date/Time
    • None
    • Windows 10, mingw5.3.0, Qt5.8, mscv2015-32bit
    • 07fffa60103fed42efed86f928fcec30f9d98815

    Description

      Upto QT 5.7 the fowllowing code works fine:

          QDateTime dt              = QDateTime::fromString("2016-12-12T07:00:00", Qt::ISODate).toUTC();
          QDateTime nextDateTime    = dt.addDays(9);
          QDateTime expected        = QDateTime::fromString("2016-12-21T07:00:00", Qt::ISODate).toUTC();
          QVERIFY(nextDateTime==expected);
      

      nextDateTime is 01.01.1970 00:16:05:873 after the addDays!

      since Qt 5.8 this test fails under Windows with mingw5.3.0 (32bit), mscv2015-32bit. On all other 64 bit test plattforms (Linux, MAC, MSCV2015-64) no fail.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            bacher Andreas Bacher
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes