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

QLocale::toString(QDateTime) forgets to output the leading zeroes for the year

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • 5.0.0 Beta 2
    • 4.8.2
    • Core: Locales (i18n)
    • None
    • Windows 7
      Ubuntu 12.04 64-bit
    • Ia025da7343d1c36aaee34c47c6db551a6e89595f

    Description

      Having the date in the string "01 January 0001", the format in the string "dd MMMM yyyy", and the C locale, QLocale::toString(QDateTime,QString) returns "01 January 1" instead of "01 January 0001"
      code snippet:

      QDateTime datetime;
      QString format("dd MMMM yyyy, hh:mm:ss");
      QString str("01 January 0001, 12:00:00");
      datetime = english.toDateTime(str,format);
      QString auxstr = english.toString(datetime.toUTC(), format);
      assert(str==auxstr); // <---------- FAIL
      

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            juagargi Juan A
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes