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: Unresolved
    • P3: Somewhat important
    • None
    • 5.7.1, 6.5
    • Core: Date/Time
    • None
    • Windows

    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:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are 2 open Gerrit changes