Re: SystemLocaleShortDate omits the century on Linux

Maurizio Berti <[email protected]>
Newsgroups gmane.comp.python.pyqt-pykde
Message-ID <CAPn+-XQi=PF=k6rB8+x-=H854DshcytCNKMstJ78Zn2Q5h1khQ@mail.gmail.com>
Taken from QDate.toString (https://doc.qt.io/qt-5/qdate.html#toString-1):

If the format is Qt::SystemLocaleShortDate or Qt::SystemLocaleLongDate, the
> string format depends on the locale settings of the system.


It completely depends on how the system "tells" what is the date format.
Apparently, Windows defaults to 4 digits for your localization, while it's
set to 2 for Linux.
You can change them in both systems: in Windows it's on the regional
settings, while on Linux it depends on your distro/window manager/etc.

Maurizio

Il giorno mer 11 mar 2020 alle ore 19:19 Sibylle Koczian <
[email protected]> ha scritto:

> Hello,
>
> on Windows SystemLocaleShortDate gives 'dd.MM.yyyy', quite correct for
> locale de-DE.
>
> On Linux (at least on ArchLinux, I didn't try other distributions) it
> gives 'dd.MM.yy' with the same locale.
>
> The documentation calls SystemLocaleShortDate "The short format used by
> the operating system". But the locale's date representation as given by
> "date +%x" in the Linux terminal shows the date as it should be,
> including the century.
>
> Why the difference?
>
> It is especially annoying with dates from this year in a QTableView: I
> always try to drag the date column wider which doesn't help.
>
> Looking for explanations,
> Sibylle
> _______________________________________________
> PyQt mailing list    [email protected]
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>


-- 
È difficile avere una convinzione precisa quando si parla delle ragioni del
cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net

_______________________________________________
PyQt mailing list    [email protected]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.