How to make it so that the month in mmmm was not July March, but July March.

Example: numberDate.toString("dd.MMMM.yyyy, hh:mm.") Will print 21.Июль.2016, 10:12 .

The variant with MMM didn’t go where Jul puts it and adding “I” to the end, since This is a hard link to a specific month. It is necessary that, depending on the month, he himself substituted the ending. You can, of course, make the conditions through just 2 months ending in “A” - Martha and Augustus in other cases display “I”, but is there an embedded solution?

    2 answers 2

    Converting a date to a string toString () uses a call

     QLocale::system().monthName(month, QLocale::LongFormat); 

    QLocale uses arrays in the process.

     static const ushort months_data[] // qlocale_data_p.h static const QLocaleData locale_data[] 

    Regular means to add the ending does not work. So either write your function, or rebuild Qt from source by changing these arrays.

      No, there is no embedded solution. In any case, the specs say nothing about this. Link to proofs .

      • I did not immediately see Qt in the tags, sorry. But, I'm afraid, as in pure language, there and in the framework you use, everything depends on the OS, which gives the data in this form. - isnullxbh