After I upgraded from mdk9.1 to mdk10, Opera Mail is using an annoying
"mm/dd/yyyy hh:MM:SS AM/PM" format and for the life of me, I can't find
any setting in Linux other than the one in KDE, which is being ignored.
Please help!
--
Kevin W :-) Contact: http://www.exclipy.com/thissite/contact.html
Opera/CSS/webdev blog: http://www.exclipy.com/
Opera uses locale aware functions for displaying time and date. You have to
modify the locale setting on your machine to change the format in opera.
Maybe some help here: http://www.userlocal.com/tips/localesettings.php
--
Espen Sand
es...@opera.com
Hmm... I never noticed, as I just started reading newsfeeds with opera,
and had never really used M2 prior to that but, before 7.50, I had
these locale settings for opera set in the startup script:
LANG="en_US"
LC_ALL="en_US"
LC_CTYPE="iso_8859-1"
With those settings I see the time string for messages in M2 displayed
as "hh:MM:SS AM/PM", which is problematic to me because the time is not
reckoned in 24 hour time, but is displayed as though it were, except
that it has AM/PM designations.
What I mean is that, at first glance:
06:00:00 PM
Looks like 6 O'clock in the morning, if you're accustomed to 24 hour
time. The string "06:00:00" explicitly means 6 O'clock in the morning,
so "06:00:00 PM" makes no sense at all. With a little tweaking...
LANG="en_US"
LC_ALL="POSIX"
LC_CTYPE="iso_8859-1"
LC_MESSAGES="en_US"
...now I get true 24 hour time, which is what I really wanted, while
keeping my preferred language, etc... but shouldn't the preceding "0"
be dropped for hours 1-9, if opera is displaying time in a 12 hour
"AM/PM" format? Or am I the only one who gets his brain locked into 24
hour mode when he sees a zero-something hour? :)
(If you're playing with the variables I mentioned, don't forget
to add them to the "export" string near the end of the script.)
--
Don't just hit reply. Email address is broken. Thank
your friendly neighborhood spammer. Email replies to:
user: jnthn1 domain: earthlink<dot>net
| What I mean is that, at first glance:
|
| 06:00:00 PM
|
| Looks like 6 O'clock in the morning, if you're accustomed to 24 hour
| time. [...] but shouldn't the preceding "0" be dropped for hours
| 1-9, if opera is displaying time in a 12 hour "AM/PM" format?
Could be, but given that opera uses locale settings, that probably
means that what opera does is subject to the definition of locales on
the machine. So you need to complain to the OS maintainers, not to
the opera maintainers, to get what you want. Or possibly you can
define your own locale. I think all the tools to do so should be
around, if you want to take the time to learn how.
Compare, e.g., the output of date +%c with different local settings.
--
* Harald Hanche-Olsen <URL:http://www.math.ntnu.no/~hanche/>
- Debating gives most of us much more psychological satisfaction
than thinking does: but it deprives us of whatever chance there is
of getting closer to the truth. -- C.P. Snow
> + "Jonathan A." <m...@privacy.net>:
>
>> ...but shouldn't the preceding "0" be dropped for hours
>> 1-9, if opera is displaying time in a 12 hour "AM/PM" format?
>
> Could be, but given that opera uses locale settings, that probably
> means that what opera does is subject to the definition of locales on
> the machine.
<snip>
> Compare, e.g., the output of date +%c with different local settings.
jnthn@:~$ export LC_ALL="en_US"
jnthn@:~$ date +%c
Tue 18 May 2004 02:31:29 PM EDT
Hrm... I didn't realize that would happen. Seems some more research is
in order. The glibc mainatainers may well have their reasons, but it
doesn't seem proper to me.
Ah well... a' googling I will go. :)
Jonathan
Thanks, it worked!
Now does anyone know an English locale with the time in 24hr and the date
in "yyyy-mm-dd" format?
> Now 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,
Thanks!
>>> Now does anyone know an English locale with the time in 24hr and the
>>> date in "yyyy-mm-dd" format?
>>
>> en_DK
>
> Thanks!
No problem... I got to learn a thing or two along the way, myself.
ciao,