On 12/10/2025 06:34, Collin Funk wrote:
This patch adds a test that the 'date' command uses the 12-hour clock or
24-hour clock depending on the current locale.

That test is testing the locale definitions as much as date(1),
so I suspect it would give false failures on various systems.

You could correlate with `date +"$(locale date_fmt)"` I suppose
(assuming `locale date_fmt` is supported by the system).

I suppose you could
Also, I noticed that 'date' uses nl_langinfo (_DATE_FMT). It appears that
_DATE_FMT is a glibc extension. Is there any reason that the
standardized D_T_FMT isn't used instead?

It looks better in my timezone (America/Los_Angeles) at least:

     $ export LC_ALL=en_US.UTF-8
     $ ./date-D_T_FMT
     Sat 11 Oct 2025 10:30:17 PM PDT
     $ ./date-_DATE_FMT
     Sat Oct 11 10:30:08 PM PDT 2025

With _DATE_FMT the year feels misplaced to me.

That's a question for glibc I think rather than coreutils
Collin

[1] https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/langinfo.h.html

There is some info about the 12/24 correlation at:
https://bugzilla.redhat.com/show_bug.cgi?id=1830623

cheers,
Padraig

Reply via email to