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

QDate::fromString() still asumes we're in the 20th century

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.0.0 Beta2
    • Core: Date/Time
    • None
    • All

      QDate::fromString("05.12.20", QLocale::system().dateFormat(QLocale::ShortFormat));
      

      returns 05.12.1920 even we're in the 21st century for some years now. Although this can't be changed for Qt5 I would assume it's fine for Qt6. The affecting code is in qdatetimeparser.cpp / QDateTimeParser::fromString():

      QDateTime val(QDate(1900, 1, 1).startOfDay());
      

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

            Eddy Edward Welbourne
            chehrlic Christian Ehrlicher
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes