Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-24437

Debugger does not correctly display the value of QDateTime variables

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 4.14.2
    • Qt Creator 4.12.0
    • Debugger
    • None
    • Qt Creator 4.12.0
      Based on Qt 5.14.2 (MSVC 2017, 32 bit)
      Built on Apr 22 2020 01:29:13
      From revision 10fece1795

      Windows 10 Enterprise
      Version 1903
      OS build 18362.959
    • Windows

    Description

      [ |https://forum.qt.io/user/cdwijs] cdwijs 6 minutes ago
       
      Summary:
      In the Qt creator debugger, I see incorrect values displayed on a QDateTime. The output from the same QDateTime value is correct when output via qDebug()

      Steps to reproduce
      1) Create a new Qt widget project in qt creator, open main.cpp, and add the following code, and set a breakpoint at the last line.
      ```
      QDateTime myqdatetime;
      qint64 start = myqdatetime.currentDateTimeUtc().toMSecsSinceEpoch();
      start = 1596782820000; //fixed value: (2020-08-07 08:47:00 localtime in the Netherlands, 2020-08-07 06:47:00 UTC)

      QDateTime startdtLt;
      QDateTime startdtUtc;
      qDebug() << start;
      startdtLt=QDateTime::fromMSecsSinceEpoch(start); //debug
      qDebug() << startdtLt;
      startdtUtc=QDateTime::fromMSecsSinceEpoch(start, Qt::UTC,0);
      qDebug() << startdtUtc;
      ```

      2) Debug the code (press F5), and see the following in the Application output. These are the correct value's:
      ```
      11:48:02: Debugging starts
      1596782820000
      QDateTime(2020-08-07 08:47:00.000 W. Europe Daylight Time Qt::LocalTime)
      QDateTime(2020-08-07 06:47:00.000 UTC Qt::UTC)
      ```

      3) Look at the right plane of qt creator. There wildly incorrect values are displayed:
      ```
      startdtLt za apr 29 20:35:56 1989 GMT+0006
      startdtUtc do jan 31 07:23:38 1974 GMT+0006
      ```

      I have also reported this in the forums:

      https://forum.qt.io/topic/117763/qdatetime-is-not-displayed-correctly-in-qt-creator-is-correct-in-qdebug-output

      Attachments

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

        Activity

          People

            davschul David Schulz
            cdwijs cdwijs
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes