2-digit years are broken

Glom tries to always show dates with 4-digit years, in your locale’s appropriate format. Nobody needs the option for it to only show 2 digits years. It just works.

I had been using C++’s insanely complex std::time_put and std::time_get thingies to do this, but for some reason the en_GB locale wants to use 2-digit years for the strftime() ‘x’ format, and there’s no way to generically specify a sane date format for the current locale. That even makes it impossible to parse any dates after 1999, because time_get parses _only_ that ‘x’ format.

That’s broken, and of no conceivable benefit to anyone, six years after Y2K. I worked around it by allowing translators to change the display format if necessary, and always using the Glib::Date fallback for parsing when they’ve done that.

2 thoughts on “2-digit years are broken

  1. One could rargue that there is too much localization in the world. Unlike language, there really is a one true date format (YYYY-MM-DD).

Comments are closed.