Apparently, though unproven, at 03:49 on Friday 07 January 2011, Stroller did 
opine thusly:

> Hi there,
> 
> Can anyone else reproduce this, please, or tell me what behaviour is
> expected?
> 
> $ locale
> LANG=en_GB.UTF-8
> LC_CTYPE="en_GB.UTF-8"
> LC_NUMERIC="en_GB.UTF-8"
> LC_TIME=en_GB.UTF-8
> LC_COLLATE="en_GB.UTF-8"
> LC_MONETARY="en_GB.UTF-8"
> LC_MESSAGES="en_GB.UTF-8"
> LC_PAPER="en_GB.UTF-8"
> LC_NAME="en_GB.UTF-8"
> LC_ADDRESS="en_GB.UTF-8"
> LC_TELEPHONE="en_GB.UTF-8"
> LC_MEASUREMENT="en_GB.UTF-8"
> LC_IDENTIFICATION="en_GB.UTF-8"
> LC_ALL=
> $ date +"%l:%M%P"
>  1:39
> $ LC_TIME="POSIX"
> $ date +"%l:%M%P"
>  1:39am
> $
> 
> I had a single line of only LANG="en_GB.UTF-8" in /etc/env.d/02locale;
> adding LC_TIME="POSIX" allows various scripts and stuff (I've written) to
> show the date properly, but I think I read somewhere that this is bad.

Your output looks fine, except for the last two commands. LC_TIME is an 
envvar, you have set it without exporting it, then ran data again and got a 
change. I don't understand how you managed that as LC_TIME would no longer be 
POSIX at that stage:

$ cat /etc/env.d/02locale
LANG="en_GB.utf8"
$ locale
LANG=en_GB.utf8
LC_CTYPE="en_GB.utf8"
LC_NUMERIC="en_GB.utf8"
LC_TIME="en_GB.utf8"
LC_COLLATE="en_GB.utf8"
LC_MONETARY="en_GB.utf8"
LC_MESSAGES="en_GB.utf8"
LC_PAPER="en_GB.utf8"
LC_NAME="en_GB.utf8"
LC_ADDRESS="en_GB.utf8"
LC_TELEPHONE="en_GB.utf8"
LC_MEASUREMENT="en_GB.utf8"
LC_IDENTIFICATION="en_GB.utf8"
LC_ALL=
$ date +"%l:%M%P"
 8:16
$ LC_TIME="POSIX"
$ date +"%l:%M%P"
 8:17
$ LC_TIME="POSIX" date +"%l:%M%P"
 8:18am


As for the "correct" way and what is "bad", I've also read stuff. I've read 
lots and lots and lots of opinions, but not much fact. So here's my own mere 
opinion:

It doesn't really matter where you set it as long as it gets the job done.
Put it in conf.d to have it global.
Put it in /etc/profile* to have it global for a shell
Put it in ~/.profile* to set it for a single user.

Or maybe you meant that you've read some people opine that setting just 
LC_TIME is bad?

-- 
alan dot mckinnon at gmail dot com

Reply via email to