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

Using QLocale to set it to English will also display Chinese

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3: Somewhat important
    • 6.9.0 FF
    • 5.7.1, 6.5
    • Core: Date/Time
    • None
    • Windows
    • e813acbb0 (dev), dea91dbb5 (dev)

    Description

      There is also such a problem in the 6.5 version of Qt

      //sample code

      QLocale locale(QLocale::English, QLocale::UnitedStates);

      QDateTime qt = locale.toDateTime("Mon, 05 Jun 2023 08:42:09", "ddd, dd MMM yyyy hh:mm:ss");
      //In the Chinese system, The following line of code will output "Mon, 05 Jun 2023 08:42:09 中国标准时间"
      qDebug()<<locale.toString(qt,"ddd, dd MMM yyyy hh:mm:ss t");

      Attachments

        Issue Links

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

          Activity

            People

              Eddy Edward Welbourne
              afeng huang weifeng
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes