Discussion:
Date/time format
(too old to reply)
exclipy
2004-05-18 07:16:41 UTC
Permalink
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
2004-05-18 08:13:38 UTC
Permalink
Post by exclipy
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
***@opera.com
Jonathan A.
2004-05-18 17:09:45 UTC
Permalink
On Tue, 18 May 2004 10:13:38 +0200, Espen Sand
Post by Espen Sand
Post by exclipy
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
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
2004-05-18 17:59:58 UTC
Permalink
+ "Jonathan A." <***@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.
2004-05-18 18:45:16 UTC
Permalink
On 18 May 2004 19:59:58 +0200, Harald Hanche-Olsen
Post by Harald Hanche-Olsen
...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>
Post by Harald Hanche-Olsen
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
--
Don't just hit reply. Email address is broken. Thank
your friendly neighborhood spammer. Email replies to:
user: jnthn1 domain: earthlink<dot>net
exclipy
2004-05-19 07:44:59 UTC
Permalink
Post by Espen Sand
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?
--
Kevin W :-) Contact: http://www.exclipy.com/thissite/contact.html
Opera/CSS/webdev blog: http://www.exclipy.com/
Jonathan A.
2004-05-19 18:20:39 UTC
Permalink
On Wed, 19 May 2004 17:44:59 +1000, exclipy
Post by exclipy
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,
Jonathan
--
Don't just hit reply. Email address is broken. Thank
your friendly neighborhood spammer. Email replies to:
user: jnthn1 domain: earthlink<dot>net
exclipy
2004-05-20 06:52:23 UTC
Permalink
Post by exclipy
Now does anyone know an English locale with the time in 24hr and the
date in "yyyy-mm-dd" format?
en_DK
Thanks!
--
Kevin W :-) Contact: http://www.exclipy.com/thissite/contact.html
Opera/CSS/webdev blog: http://www.exclipy.com/
Jonathan A.
2004-05-20 14:48:41 UTC
Permalink
On Thu, 20 May 2004 16:52:23 +1000, exclipy
Post by exclipy
Post by exclipy
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,
Jonathan
--
Don't just hit reply. Email address is broken. Thank
your friendly neighborhood spammer. Email replies to:
user: jnthn1 domain: earthlink<dot>net
s***@gmail.com
2017-05-16 13:20:01 UTC
Permalink
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
Post by Jonathan A.
On Wed, 19 May 2004 17:44:59 +1000, exclipy
Post by exclipy
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
<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
(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
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
user: jnthn1 domain: earthlink<dot>net
Jorgen Grahn
2017-05-18 20:29:01 UTC
Permalink
...
Post by s***@gmail.com
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
2017-05-22 15:26:54 UTC
Permalink
Post by Jorgen Grahn
...
Post by s***@gmail.com
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.

Continue reading on narkive:
Loading...