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

QML Date operations are wrong when DST is active

    XMLWordPrintable

Details

    • Windows
    • 13
    • dff02466a0 (qt/qtdeclarative/dev) 3033e99fa8 (qt/qtdeclarative/6.4) 3033e99fa8 (qt/tqtc-qtdeclarative/6.4)
    • Team A Foundation Sprint 56, Team A Foundation Sprint 57, Team A Foundation Sprint 58, Team A Foundation Sprint 59

    Description

      Steps to reproduce

      1. Set your PC's Region to France and Time Zone to "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna" (CEST)
      2. Add this to a Hello World QML project:

       

      Component.onCompleted: {
          let d = new Date()
          console.log("Now: " + d)
          d.setHours(0, 0, 0)
          console.log("Midnight: " + d)
      }
      

       

       

      MSVC 2019 64-bit results (correct)

      qml: Now: Tue Aug 24 15:37:35 2021 GMT+0200

      qml: Midnight: Tue Aug 24 00:00:00 2021 GMT+0200

       

      MinGW 8.1.0 64-bit results (wrong)

      qml: Now: Tue Aug 24 15:37:41 2021 GMT+0100

      qml: Midnight: Tue Aug 24 01:00:00 2021 GMT+0100

       

      • 1st line shows the correct local time but the wrong timezone 
      • 2nd line does not show midnight (and also shows the wrong timezone)

      Attachments

        Issue Links

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

          Activity

            People

              Eddy Edward Welbourne
              skoh-qt Sze Howe Koh
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: