On 4/30/26 7:25 PM, Collin Funk wrote:
[...] David Chmelik <[email protected]> writes:
I'm British-American and lived on both sides of Atlantic, so consider
American time/date format the world's worst. ISO date is good, but
not as specific. I'd like to be able for my OSs date command to
output in standard format like (for today): 'Thu 30 Apr 13:00:00 PDT
2026' by default, i.e. put day, month, year in ascending order, which
should be doable with something such as a coreutils.conf or date.conf
rather than typing (not worth the time) or overloading/aliasing (not
good if I have the reason to display it another way).
You are using GNU/Linux, I assume?
I use it and UNIX (Open Solaris/Illumos, *BSD).
We use the format specified by
'locale date_fmt' there, so you can just use locales to do this:
$ LC_ALL=en_US.UTF-8 date -d '2026-04-30T13:00'
Thu Apr 30 01:00:00 PM PDT 2026
$ LC_ALL=en_GB.UTF-8 date -d '2026-04-30T13:00'
Okay!
Thu 30 Apr 13:00:00 PDT 2026
You can define a shell function in one of your startup files for this:
date ()
{
LC_TIME=en_GB.UTF-8 command date "$@"
}
Thanks! Of course, for bash, I wrote 'function date()' then the rest.
I don't know much about locale stuff as what I use most
(FreeSlack/Freenix when not needing binary blobs, or Slackware when)
historically didn't bother with so much locale stuff.
Using LC_TIME means that your error messages and such will still be in
American English, if that is what you prefer. [...]
I don't, but can live with it; I only use my geographic locale for
dollar sign. If I could get error messages in British English, that'd
be best, even though I finished my English classes in later
primary/elementary and secondary/high school in American English...
--D