Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-26038 Make Date/Time adhere to ISO 8601
  3. QTBUG-11623

QDateTime::fromString doesn't accept Time Zone Designator, even with Qt::ISODate as date format

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.0
    • Core: Date/Time
    • None
    • fa650284ad6a838118946be88ac9c73a83361391

    Description

      QDateTime::fromString( str, Qt::ISODate ) seems not to be ISO8601 compatible. If I use time zone designator then QDateTime has invalid value (time is 00:00:00), however it returns that it's valid.
      Try please these few lines:
      //
      QDateTime time = QDateTime::fromString( "1987-02-13T13:24:51+01:00", Qt::ISODate );
      bool isValid = time.isValid(); //isValid == true ???
      QString str = time.toString(); //"Fri Feb 13 00:00:00 1987" ???

      Attachments

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

        Activity

          People

            liaqi Liang Qi
            bodzio131 Bogdan Slusarczyk
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes