Home > Mobile >  Qt week display the current time
Qt week display the current time

Time:10-06

The UI - & gt; Datetime - & gt; SetText (QDateTime: : currentDateTime (), toString (" the current time is: yyyy - MM - dd hh: MM: ss DDDD "));
Displays only the English version of how to transform into a Chinese version of the week

CodePudding user response:

If LZ QT version is in English, or the system language is English, I am here is in Chinese,,,,,,,

CodePudding user response:



The Chinese version of

CodePudding user response:

Is to set up the QLocale

CodePudding user response:

According to yourself in English into Chinese, not just 7 days

CodePudding user response:

CodePudding user response:

Language setting to Chinese version

CodePudding user response:

 
QDateTime dateTime=QDateTime: : currentDateTime ();
QLocale locale=QLocale: : Chinese;//specified in Chinese shows
//QLocale locale=QLocale: : English;//specified English
//QLocale locale=QLocale: : Japanese;//specify the Japanese show
QString strFormat="current time is: yyyy - MM - dd hh: MM: ss DDDD";
QString strDateTime=locale. ToString (dateTime, strFormat);
QDebug () & lt;
  •  Tags:  
  • Qt
  • Related