[Interest] Wrong time format from QLocale

John Layt jlayt at kde.org
Fri Mar 23 19:56:12 CET 2012


On 22 March 2012 20:18, NoRulez <norulez at me.com> wrote:
> 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().timeFormat(QLocale::LongFormat);
>
> qDebug() << QLocale::system().timeFormat(QLocale::ShortFormat);
>
> produces:
>
> "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:
>
> Time (short): HH:mm
> Time (long): HH:mm:ss

The QLocale code obtains the same LOCALE_STIMEFORMAT value from
Windows for both long and short format.  This is probably due to
historic reasons, perhaps earlier versions of Windows only had one
time format or something.

Please raise a bug requesting this to be fixed and I'll see what I can do.

John.



More information about the Interest mailing list