[Interest] Wrong time format from QLocale

NoRulez norulez at me.com
Thu Mar 22 21:18:03 CET 2012


Hello @all,

I want to use the date/time format from QLocale but I get a wrong result for the short time format.
The following code:

qDebug() << QLocale::system().dateFormat(QLocale::LongFormat);

qDebug() << QLocale::system().dateFormat(QLocale::ShortFormat);

qDebug() << QLocale::system().timeFormat(QLocale::LongFormat);

qDebug() << QLocale::system().timeFormat(QLocale::ShortFormat);

produces:

"dddd, dd. MMMM yyyy" 

"dd.MM.yyyy"

"HH:mm:ss"

"HH:mm:ss"


The short time format is wrong.
I use Windows 7 with Qt 4.8 from the QtSDK.

The settings under Windows 7 are:

Date (short): TT.MM.JJJJ
Date (long): TTTT, TT.MMMM JJJJ
Time (short): HH:mm
Time (long): HH:mm:ss

Could someone please help?

Thanks in advance

Best Regards
NoRulez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120322/928be724/attachment.html>


More information about the Interest mailing list