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

SystemTime::setTime broken

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.14.0
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      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

            Assignee:
            papetaja Pasi Petäjäjärvi
            Reporter:
            damienlefevre Damien LEFEVRE
            PM Owner:
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes