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

QLocale::toDateTime fails to parse February 29th

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 4.8.0
    • Core: Date/Time
    • None

      Qt 4.8.0 returns an invalid QDateTime in the following code:

         
      #include <QtCore>
      #include <iostream>
      
      int main(int argc, char* argv[]) {
              QString feb29 = "Feb 29 09:10";
              QString format = "MMM dd hh:mm";
      
              QDateTime dt = QLocale::c().toDateTime(feb29, format);
      
              std::cout << "valid = " << dt.isValid() << std::endl;
      
              return 0;
      }
      

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

            Unassigned Unassigned
            fmercille Frédéric Mercille
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes