Some Bits: Nelson's log

ISO dates and Unix locale

I want my dates to be displayed in ISO year-month-day like this: 2026-06-09. And I want my times to be in 24 hour clocks with leading zeroes, like this: 08:37.

There is no Unix locale to reliably do this.

There is a hack, which is to set LC_TIME=en_DK.UTF-8. en_DK is a weird confection meaning “Danish formatting but with English words”. glibc defines it to be like I want. Problem solved?

Unfortunately not entirely. Because actual Danish people sometimes write times with dots instead of colons. 08.37. I’m not entirely sure where all this happens but KDE Plasma is showing my system clock that way.

What we could really use is a synthetic locale for international use. A locale that prints ISO dates and times.

We could also use a synthetic UTC timezone. Right now I use Reykjavik time on servers, since that’s GMT+00:00 and doesn’t do timezone shifts. But it’d be nice to have an explicit “UTC” option. Some systems do have that, actually, but a lot of software expects a geographic time zone. The ones that make you pick off a map are the worst.

(I feel like this blog post is self-parody, the most detailed of minutiae. But we use these dates and times everywhere! Why don’t they display the way I want, according to the primary international standard?)

Comments

kuro68k 

I feel your pain.

One of my long term projects is to reverse engineer a nice big clock LCD enough to make my own version that displays UTC and TAI. Almost nothing supports TAI, except NTP and PTP, which don't display anything by themselves.