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

Something fishy going on on MinGW with QML Date

    XMLWordPrintable

Details

    • Windows
    • 21
    • dff02466a0 (qt/qtdeclarative/dev) 3033e99fa8 (qt/qtdeclarative/6.4) 3033e99fa8 (qt/tqtc-qtdeclarative/6.4)
    • Team A Foundation Sprint 59

    Description

      Originally reported as a re-opening of QTBUG-78996 by peppe. Moved here because it is a separate bug.
      My computer local timezone is set to CEST.

      This snippet:

              let i = 0;
              console.log("Row", ++i, new Date(Date.UTC(2021, 6)))
              console.log("Row", ++i, new Date(Date.UTC(2021, 7, 0)))
      
              console.log("Row", ++i, new Date(Date.UTC(2021, 6)).getDate())
              console.log("Row", ++i, new Date(Date.UTC(2021, 7, 0)).getDate())
      
              console.log("Row", ++i, new Date(2021, 6))
              console.log("Row", ++i, new Date(2021, 7, 0))
      
              console.log("Row", ++i, new Date(2021, 6).getDate())
              console.log("Row", ++i, new Date(2021, 7, 0).getDate()) 

      On MSVC prints:

      qml: Row 1 Thu Jul 1 02:00:00 2021 GMT+0200
      qml: Row 2 Sat Jul 31 02:00:00 2021 GMT+0200
      qml: Row 3 1
      qml: Row 4 31
      qml: Row 5 Thu Jul 1 00:00:00 2021 GMT+0200
      qml: Row 6 Sat Jul 31 00:00:00 2021 GMT+0200
      qml: Row 7 1
      qml: Row 8 31 

      And on MinGW prints:

      qml: Row 1 Thu Jul 1 02:00:00 2021 GMT+0100
      qml: Row 2 Sat Jul 31 02:00:00 2021 GMT+0100
      qml: Row 3 1
      qml: Row 4 31
      qml: Row 5 Thu Jul 1 00:00:00 2021 GMT+0100
      qml: Row 6 Sat Jul 31 00:00:00 2021 GMT+0100
      qml: Row 7 30
      qml: Row 8 30 

       

      If I dump QDateTime::currentDateTime, on both compilers I get

      QDateTime(2021-07-14 20:53:49.858 Romance Daylight Time Qt::LocalTime)
      

      So, 1) why is the timezone off by 1 hour when using MinGW?
      And 2) why does it think that July has 30 days?

      Attachments

        Issue Links

          Activity

            People

              Eddy Edward Welbourne
              Eddy Edward Welbourne
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: