Time formats / LC_TIME challenge for 4-digit year support

Jaroslaw Staniek staniek at kde.org
Tue Dec 4 19:42:41 GMT 2018

On Tue, 4 Dec 2018 at 20:10, Albert Astals Cid <aacid at kde.org> wrote:

> El dilluns, 3 de desembre de 2018, a les 14:47:56 CET, Jaroslaw Staniek va
> escriure:
> > Hello,
> > The need: 4-digit year support for short date formats to avoid issues
> like
> > "10/11/12" dates.
> What's wrong with 10/11/12 ?

It's a problem. Year 2000 problem.

> > This is just my initial conclusion from for the Qt date format issue:
> >
> >
> https://bugreports.qt.io/browse/QTBUG-59382?focusedCommentId=436861&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-436861
> > lt;dr: KF5 context: KCallendarSystem is part of the old APIs and the only
> > code I found related to LC_TIME.
> >
> > So I've not found any common code KDE app can use instead of hard coding
> > some internal logic in order to support non-Plasma environments and/or
> > non-global settings. Basically even if an app implements locale name
> > selection in its private settings, "pure" Qt code is not enough to
> support
> > it in the discussed cases. Users may need alter date format globally (for
> > all apps) by hand using environment's settings, setting e.g. yyyy-mm-dd.
> Or
> > app developers may add private setting for that, one per app.
> >
> > Opinions welcome.
> I am not sure i understand your email/problem.
> As far as i read this email your concern is:
>  * localized dates use the locale date format
>  * locale date format is "wrong".

Yes. "Opinions welcome" mostly meant sending "do you have this kind of
issues in your apps" question to app developers who happen to use KF5+Qt.

> So the two options are:
>  a) User changes their locale
 b) Apps don't use localized dates and use a custom format.
> Am I understanding your email correctly?

Yes, I discussed pros and cons of a) and b).

Doing a) means the user changing global locale is responsible for finding
locale that matches format which Qt implements as expected (if not, that's
rare problem but unfortunately happened for the ISO format explained in the
Qt ticket). And possibly, finding format that won't break non-Qt apps that
may use different locale infra.
Or if the user changes the format by hand, but still does so in the system
locale settings, she's more in control as this is a global setting, not

b) Has pros and cons but cons can be reduced by this option being opt-in
and default coming from the locale.

I did not know there are such differences for the locale system. But by no
means my email is a call to "patch" the Qt-level problem by having a KF5
solution. And I am skeptical if Qt can be patched in version 5 with such
incompatible change. Hopefully these poor man analysis help some other app
developers :)

regards, Jaroslaw Staniek

: A world-wide network of software engineers, artists, writers, translators
: and facilitators committed to Free Software development - kde.org
: A visual database apps builder - kexi-project.org calligra.org/kexi
  twitter.com/kexi_project facebook.com/kexi.project t.me/kexi_project
Qt Certified Specialist:
: linkedin.com/in/jstaniek <http://www.linkedin.com/in/jstaniek>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20181204/4f142d07/attachment.htm>

More information about the kde-core-devel mailing list