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

QDateTime wrong daylight savings under windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.12.0 Alpha
    • 4.8.5, 5.0.2, 5.1.1, 5.2.0 Beta1
    • Core: Date/Time
    • None
    • Windows 7
    • 6d3e5ac6d2f34a0da609f863bed95d3be571c589

      Under windows it shows wrong daylight savings before 2007 on US eastern time -05:00

      Windows
      "UTC" "Wed Nov 1 12:00:00 2006"
      "Local" "Wed Nov 1 08:00:00 2006" <-
      "UTC" "Thu Nov 1 12:00:00 2007"
      "Local" "Thu Nov 1 08:00:00 2007"

      Mac/Linux
      "UTC" "Wed Nov 1 12:00:00 2006"
      "Local" "Wed Nov 1 07:00:00 2006" <-
      "UTC" "Thu Nov 1 12:00:00 2007"
      "Local" "Thu Nov 1 08:00:00 2007"

      Example:
      int main()
      {
      qDebug()
      << "UTC" << QDateTime( QDate( 2006, 11, 1 ), QTime( 12, 0, 0 ), Qt::UTC ).toString() << endl
      << "Local" << QDateTime( QDate( 2006, 11, 1 ), QTime( 12, 0, 0 ), Qt::UTC ).toLocalTime().toString() << endl
      << "UTC" << QDateTime( QDate( 2007, 11, 1 ), QTime( 12, 0, 0 ), Qt::UTC ).toString() << endl
      << "Local" << QDateTime( QDate( 2007, 11, 1 ), QTime( 12, 0, 0 ), Qt::UTC ).toLocalTime().toString() << endl;
      }

      If use windows native API from MSDN then it handles correctly daylight savings

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

            Eddy Edward Welbourne
            raulinno Raul Metsma
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes