On Wed, 19 May 2004 17:44:59 +1000, exclipy
Post by exclipyNow does anyone know an English locale with the time in 24hr and the date
in "yyyy-mm-dd" format?
There is a locale that does this... that's the ISO-8601 format for
date strings, BTW. A google for LC_TIME + ISO-8601 yielded this
thread on the debian-user archive about the locale "en_DK":
<http://lists.debian.org/debian-user/2002/11/msg00750.html>
I don't think that locale is generally configured in a default install
of whatever distro. It wasn't on my Slackware 9.0 system. If you don't
have a directory "en_DK" in your locales directory, your system hasn't
been configured for it. What I did to set it up was to run, as root:
(The usual disclaimers apply... never run a command as root if you
don't know what it does... RTFM... etc, etc.)
localedef -c -i en_DK /usr/share/locale/en_DK
localedef --add-to-archive /usr/share/locale/en_DK
and got:
jnthn@:~$ LC_ALL="" LC_TIME="en_DK" date +%c
2004-05-19T13:49:25 EDT
Note that if you have the environment variable "LC_ALL" set to anything,
it will override LC_TIME among others... see man 7 locale. You may want
to explicitly set the others to your usual locale, and reserve the en_DK
locale for LC_TIME only if you use it. I want LC_ALL="POSIX" in my bash
env, so I edited the opera startup script rather than .bash_profile...
LANG="en_US"
LC_ALL=""
LC_COLLATE="en_US"
LC_CTYPE="iso_8859-1"
LC_MESSAGES="en_US"
LC_MONETARY="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_DK"
And now dates in opera show in ISO-8601 format (yyyy-MM-dd HH:mm:ss)
Testing seems to show that there's no need to add the variables to the
"export" line at the end of the script, but I did anyway... I need to
learn exactly when and why exporting variables is necessary, I suppose.
HTH,
Jonathan
--
Don't just hit reply. Email address is broken. Thank
your friendly neighborhood spammer. Email replies to:
user: jnthn1 domain: earthlink<dot>net