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

QLocale::ShortFormat prints wrong date on some machine

    XMLWordPrintable

Details

    • macOS

    Description

      Following little code prints wrong date on some Mac machine:

      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QDate date(1900,1,1);
          QLocale locale;
          QString szDate = locale.toString( date,locale.dateFormat(QLocale::FormatType::ShortFormat) );
          qDebug()<<szDate<<locale.dateFormat(QLocale::ShortFormat);
          return app.exec();
      }
      
      Above code prints  (1899-12-12) 
      above code with us locale prints 12/31/99
      M/d/yy
      

      This problem is happening with any date 1900 to 1990

      Attachments

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

        Activity

          People

            irfan.omair@digia.com Irfan Omair
            irfan.omair@digia.com Irfan Omair
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes