Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Date/time format

402 views
Skip to first unread message

exclipy

unread,
May 18, 2004, 3:16:41 AM5/18/04
to
Where does Opera get its date/time format from?

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/

Espen Sand

unread,
May 18, 2004, 4:13:38 AM5/18/04
to
exclipy wrote:
> Where does Opera get its date/time format from?
>
> 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!

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

Jonathan A.

unread,
May 18, 2004, 1:09:45 PM5/18/04
to

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

Harald Hanche-Olsen

unread,
May 18, 2004, 1:59:58 PM5/18/04
to
+ "Jonathan A." <m...@privacy.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.

unread,
May 18, 2004, 2:45:16 PM5/18/04
to
On 18 May 2004 19:59:58 +0200, Harald Hanche-Olsen
<han...@math.ntnu.no> appears to have said:

> + "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

exclipy

unread,
May 19, 2004, 3:44:59 AM5/19/04
to
> 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

Thanks, it worked!

Now does anyone know an English locale with the time in 24hr and the date
in "yyyy-mm-dd" format?

Jonathan A.

unread,
May 19, 2004, 2:20:39 PM5/19/04
to
On Wed, 19 May 2004 17:44:59 +1000, exclipy
<con...@in.sig> appears to have said:

> 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,

exclipy

unread,
May 20, 2004, 2:52:23 AM5/20/04
to
>> Now does anyone know an English locale with the time in 24hr and the
>> date in "yyyy-mm-dd" format?
>
> en_DK

Thanks!

Jonathan A.

unread,
May 20, 2004, 10:48:41 AM5/20/04
to
On Thu, 20 May 2004 16:52:23 +1000, exclipy

<con...@in.sig> appears to have said:

>>> 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,

soccer...@gmail.com

unread,
May 16, 2017, 9:20:01 AM5/16/17
to
Sorry, I know this is an old post and this is my first Google Groups Post. How do you change Opera to match ISO8601 format? I can't seem to find the Opera Startup Script.

Cheers

Jorgen Grahn

unread,
May 18, 2017, 4:29:03 PM5/18/17
to
On Tue, 2017-05-16, soccer...@gmail.com wrote:
> On Wednesday, 19 May 2004 14:20:39 UTC-4, Jonathan A. wrote:
...

> Sorry, I know this is an old post and this is my first Google Groups
> Post. How do you change Opera to match ISO8601 format? I can't seem
> to find the Opera Startup Script.

I don't think anyone reads opera.linux these days.

I stopped using the browser at the big rewrite a few years back, so I
cannot help. Sorry!

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .

GrailKing

unread,
May 22, 2017, 11:26:55 AM5/22/17
to
On Thu, 18 May 2017 20:29:01 +0000, Jorgen Grahn wrote:

> On Tue, 2017-05-16, soccer...@gmail.com wrote:
>> On Wednesday, 19 May 2004 14:20:39 UTC-4, Jonathan A. wrote:
> ...
>
>> Sorry, I know this is an old post and this is my first Google Groups
>> Post. How do you change Opera to match ISO8601 format? I can't seem to
>> find the Opera Startup Script.
>
> I don't think anyone reads opera.linux these days.
>
> I stopped using the browser at the big rewrite a few years back, so I
> cannot help. Sorry!
>
> /Jorgen

You may want to go to the Opera community forums in the browser to get
answers.

0 new messages