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

[REG: 5.4->5.5] Wrong looking behaviour with QDateTime::addDays over DST switch

    XMLWordPrintable

Details

    • 81858bf1722081d99fdea72f55e67c04c5bb3d92

    Description

      When on Europe/Helsinki timezone, these two seemingly similar programs give different results:

          const QDateTime fromUTC = QDateTime(QDate(2015, 3, 28), QTime(4, 0, 0), Qt::UTC).toLocalTime();
          qDebug() << fromUTC.addDays(1).toString();
      
      // "Sun Mar 29 07:00:00 2015"
      
          const QDateTime localtime = QDateTime(QDate(2015, 3, 28), QTime(6, 0, 0), Qt::LocalTime);
          qDebug() << localtime.addDays(1).toString();
      
      // "Sun Mar 29 06:00:00 2015"
      

      This was introduced by commit: 3b36a550b04fbdfca835002c9c090be8099afa7f

      Attachments

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

        Activity

          People

            Eddy Edward Welbourne
            poikelin Joni Poikelin
            Votes:
            1 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes