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

QDate::fromString cannot parse date of year 8000 and later

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.11.0
    • 4.3.3, 4.8.5, 5.1.0
    • Core: Date/Time
    • None
    • Windows 7 Professional (Windows NT 6.1)
      Visual Studio 2005, Behavior is platform independent
    • a755c2e52126bea850a04487a9a7d446b03e892a

    Description

      Try the following code. The year will not be displayed.
      While date can handle years till 11754508 (Dec 13th) the range of QDate::fromString ends with year 7999 (Dec 31st).

      #include <QString>
      #include <QDate>
      void main()
      {
        const QDate date = QDate::fromString("8000-01-01", "yyyy-MM-dd");
        qDebug("Date is: %s", date.toString("yyyy-MM-dd").toLatin1().constData());
      }
      

      Attachments

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

        Activity

          People

            johnlayt John Layt
            frankyboy Frank Gsellmann
            Votes:
            3 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes