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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Duplicate
    • Affects Version/s: 6.0.0 Beta2
    • Fix Version/s: None
    • Component/s: Core: Date/Time
    • Labels:
      None
    • Platform/s:
      All

      Description

      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());
      

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-89147
          # Subject Branch Project Status CR V

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There is 1 open Gerrit change