Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #222079

Re: Output from date command defaults to 12-hour in Buster.

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: Output from date command defaults to 12-hour in Buster.
Date 2020-04-29 14:10 +0200
Message-ID <A0THk-xF-9@gated-at.bofh.it> (permalink)
References <A0JRD-2s2-3@gated-at.bofh.it> <A0OeC-5s2-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Apr 29, 2020 at 09:11:05AM +0300, Reco wrote:
> If you need it systemwide, consider doing this (will require relogin, at
> least):
> 
> echo 'LC_TIME=C' >> /etc/default/locale

I do not recommend hard-coding locales system-wide.  Individual users
should be free to set their own environments.

> If you need it for your user only (will require a new terminal emulator), 
> 
> echo 'LC_TIME=C' >> ~/.bashrc

You'll need to export it, in order for it have any effect on external
commands (like date).

The choice of .bashrc may be fine for GNOME users (hell, it may even be
*mandatory* for GNOME users, because GNOME is user-unfriendly shit),
but even then, it only affects commands that are launched from an
interactive shell.

In order to take effect in commands that are launched by the window
manager, or whatever, environment changes should be done much earlier
in the session.

For shell logins, you would want to put the command(s) in ~/.profile or
whatever your login shell's equivalent dot file is.

For GUI logins that are not GNOME, you can try setting up the environment
in ~/.xsessionrc -- but note that your Desktop Environment (even if it's
not GNOME) may overwrite whatever you try to set.

If it's GNOME, well, you're screwed.  GNOME has its own idea of how to
set up the user's locale, and it does not include such subtle concepts as
"use one locale for most things, but fine-tune LC_COLLATE and LC_TIME".
This has come up in the past on this mailing list, and there is no known
solution to it (other than "don't use GNOME").


The last time the "date in buster" issue came up, I experimented with
a customized locale -- see my write-up at
<https://www.mail-archive.com/debian-user@lists.debian.org/msg741047.html>
or whatever list archive Google happens to choose for you.

Since that time, I abandoned that approach.  It's too clunky in real
life -- too much trouble, too many opportunities for something to go
wrong, e.g. the environment variable doesn't get set where it needs
to be set, or *does* get set where it shouldn't, like inside a chroot
or similar encapsulation.

I just went with the LC_TIME=C approach instead.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Output from date command defaults to 12-hour in Buster. "Martin McCormick" <martin.m@suddenlink.net> - 2020-04-29 03:40 +0200
  Re: Output from date command defaults to 12-hour in Buster. Roberto C. Sánchez <roberto@debian.org> - 2020-04-29 03:50 +0200
    Re: Output from date command defaults to 12-hour in Buster. Charles Curley <charlescurley@charlescurley.com> - 2020-04-29 07:00 +0200
      Re: Output from date command defaults to 12-hour in Buster. Greg Wooledge <wooledg@eeg.ccf.org> - 2020-04-29 13:50 +0200
        Re: Output from date command defaults to 12-hour in Buster. Nicolas George <george@nsup.org> - 2020-04-29 14:10 +0200
          Re: Output from date command defaults to 12-hour in Buster. Andrei POPESCU <andreimpopescu@gmail.com> - 2020-04-29 19:10 +0200
            Re: Output from date command defaults to 12-hour in Buster. Nicolas George <george@nsup.org> - 2020-04-29 19:20 +0200
              Re: Output from date command defaults to 12-hour in Buster. Andrei POPESCU <andreimpopescu@gmail.com> - 2020-04-30 10:30 +0200
                Re: Output from date command defaults to 12-hour in Buster. Greg Wooledge <wooledg@eeg.ccf.org> - 2020-04-30 13:20 +0200
                Re: Output from date command defaults to 12-hour in Buster. Nicolas George <george@nsup.org> - 2020-04-30 17:10 +0200
        Re: Output from date command defaults to 12-hour in Buster. "Martin McCormick" <martin.m@suddenlink.net> - 2020-04-29 16:00 +0200
          Re: Output from date command defaults to 12-hour in Buster. Greg Wooledge <wooledg@eeg.ccf.org> - 2020-04-29 16:30 +0200
            Re: Output from date command defaults to 12-hour in Buster. l0f4r0@tuta.io - 2020-04-29 18:20 +0200
  Re: Output from date command defaults to 12-hour in Buster. Reco <recoverym4n@enotuniq.net> - 2020-04-29 08:20 +0200
    Re: Output from date command defaults to 12-hour in Buster. Greg Wooledge <wooledg@eeg.ccf.org> - 2020-04-29 14:10 +0200
      Re: Output from date command defaults to 12-hour in Buster. Nicolas George <george@nsup.org> - 2020-04-29 14:20 +0200
    Re: Output from date command defaults to 12-hour in Buster. Greg Wooledge <wooledg@eeg.ccf.org> - 2020-04-29 15:10 +0200
      Re: Output from date command defaults to 12-hour in Buster. "Martin McCormick" <martin.m@suddenlink.net> - 2020-04-29 18:30 +0200
    Re: Output from date command defaults to 12-hour in Buster. "Martin McCormick" <martin.m@suddenlink.net> - 2020-04-29 15:10 +0200
  Re: Output from date command defaults to 12-hour in Buster. James Cloos <cloos@jhcloos.com> - 2020-05-01 18:30 +0200

csiph-web