I need to get the correct month and day format for different locales. I have QLable and QDate, the label should display month and day. I am trying QLocale format date.
//Yes, I got system locale and set is as default
QLocale::toString(date, "MMMM d");
But the result is incorrect.
For example, "MMMM d" in German corresponds to:
"d. MMMM"
for french language:
"d MMMM"
How to convert the "MMMM d" format to local settings in Qt 4.8?
Thank!
PS In javascript I use the following code
var date = new Date(Date.UTC(2012, 11, 20, 3, 0, 0));
var options = {month: 'long', day: 'numeric' };
console.log(date.toLocaleDateString('de-DE', options));
source
share