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

SystemTime::setTime broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • 5.14.0
    • None
    • Linux/Yocto

    Description

      Impossible to set date and time with SystemTime::setTime 

      Code to reproduce

      SystemTime *systemTime = new SystemTime(this);
      QString dateTimeStr = "2020-04-10 - 12:24";
      QDateTime dateTime = QDateTime::fromString(dateTimeStr, "yyyy-MM-dd HH:mm");
      systemTime->setTime(dateTime);
      qDebug() << "Setting date to: " << dateTime;
      qDebug() << "New date is: " << systemTime->time();
      

      Output

      Setting date to:  QDateTime(2020-04-10 12:24:00.000 UTC Qt::LocalTime)
      New date is:  QDateTime(2020-02-04 18:51:12.018 UTC Qt::LocalTime)
      

      Attachments

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

        Activity

          People

            papetaja Pasi Petäjäjärvi
            damienlefevre Damien LEFEVRE
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes