After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608474 - empathy chat timestamps not in gnome-specified format
empathy chat timestamps not in gnome-specified format
Status: RESOLVED OBSOLETE
Product: empathy
Classification: Core
Component: Chat
2.32.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
empathy-maint
: 657356 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-01-29 18:26 UTC by Joe Barnett
Modified: 2018-05-22 14:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.31/2.32


Attachments
empathy-time: port to TP coding style (6.91 KB, patch)
2012-01-19 16:08 UTC, Guillaume Desmottes
committed Details | Review
Use org.gnome.system.locale.region when displaying dates (2.36 KB, patch)
2012-01-19 16:09 UTC, Guillaume Desmottes
rejected Details | Review
stop translating date/time formats (1.25 KB, patch)
2012-01-19 16:09 UTC, Guillaume Desmottes
none Details | Review
Use a localized format when displaying times (1.65 KB, patch)
2012-01-20 10:39 UTC, Guillaume Desmottes
committed Details | Review
test script (462 bytes, text/x-python)
2012-01-20 10:42 UTC, Guillaume Desmottes
  Details

Description Joe Barnett 2010-01-29 18:26:13 UTC
For long running IM conversations, empathy helpfully displays a timestamp every so often. unfortunately, does not respect the configured-elsewhere-in-gnome/locale date/time format, and displays, for example "16:05" instead of "4:05 PM".
Comment 1 Fabio Durán Verdugo 2010-01-30 01:28:47 UTC
work fine for me in empathy 2.29.6
If I config for "16:05" for gnome-locale config, empathy show "16:05"
Comment 2 Guillaume Desmottes 2010-02-08 16:53:51 UTC
Joe: Which version are you using? Could you try with 2.29.6 please?
Comment 3 Marcus Sundman 2010-02-24 22:23:29 UTC
I have only tried 2.28.1.1, and it doesn't work.
E.g., "env LC_TIME=en_US.UTF-8 empathy" makes empathy show "16:05" instead of "04:05:00 PM" (whereas "env LC_TIME=en_US.UTF-8 date -d '16:05' +%X" displays "04:05:00 PM" as it should).
Comment 4 Joe Barnett 2010-02-24 22:46:47 UTC
in empathy 2.29.91, i see:

- Wednesday February 24 2010, 13:28 -

(instead of 1:28PM)
Comment 5 Joe Barnett 2010-02-24 22:57:44 UTC
looks like libempathy-gtk/empathy-chat-text-view.c does:

	tmp = empathy_time_to_string_local (timestamp, EMPATHY_TIME_FORMAT_DISPLAY_SHORT);

where libempathy/empathy-time.h defines:
 
       #define EMPATHY_TIME_FORMAT_DISPLAY_SHORT "%H:%M"


would changing chat-text-view.c to:

	tmp = empathy_time_to_string_local (timestamp, _(EMPATHY_TIME_FORMAT_DISPLAY_SHORT));

work?  ... not sure how these things are usually localized, and just randomly guessing ...




....


(also, to clarify, I'm expecting 12-hour (1:28PM) time format with en_US.UTF-8 locale.)
Comment 6 Fabio Durán Verdugo 2010-04-05 22:22:55 UTC
this bug is still reproduce?
Comment 7 Joe Barnett 2010-04-05 22:26:50 UTC
yes
Comment 8 Fabio Durán Verdugo 2010-04-05 22:32:21 UTC
what is version? -> empathy
Comment 9 Joe Barnett 2010-04-05 22:33:54 UTC
2.30.0
Comment 10 Guillaume Desmottes 2010-09-21 08:23:45 UTC
Could you try with 2.31.92 (or the upcoming 2.32.0) plese? We change a few things in this code to improve localisation.
Comment 11 Jack Twilley 2010-10-11 23:22:21 UTC
I am using 2.32.0 and I get inconsistent timestamp formats.  Here's an example:

madLyfe has joined the room 16:21	

ZykoticK9_ 10/11/2010 04:20:59 PM
!puregnome | Cuervo

Ignoring the fact that the two events seem misordered -- I cut-and-pasted them as they arrived -- I would like to make the 'from a message' timestamp format the same as the 'join/quit' timestamp.  How do I do that?
Comment 12 Guillaume Desmottes 2011-10-31 16:32:56 UTC
*** Bug 657356 has been marked as a duplicate of this bug. ***
Comment 13 Guillaume Desmottes 2012-01-19 16:08:55 UTC
Created attachment 205636 [details] [review]
empathy-time: port to TP coding style
Comment 14 Guillaume Desmottes 2012-01-19 16:09:01 UTC
Created attachment 205637 [details] [review]
Use org.gnome.system.locale.region when displaying dates
Comment 15 Guillaume Desmottes 2012-01-19 16:09:05 UTC
Created attachment 205638 [details] [review]
stop translating date/time formats

We don't have to any more as we respect GNOME's region setting.
Comment 16 Xavier Claessens 2012-01-19 17:27:39 UTC
If that's how it is supposed to be used, then +1
Comment 17 Christian Dywan 2012-01-19 21:27:07 UTC
I may be missing something here, but how is %H:%M supposed to change to %I.%M?
Comment 18 Guillaume Desmottes 2012-01-20 10:30:57 UTC
Comment on attachment 205636 [details] [review]
empathy-time: port to TP coding style

Attachment 205636 [details] pushed as 11de29c - empathy-time: port to TP coding style
Comment 19 Guillaume Desmottes 2012-01-20 10:31:43 UTC
Review of attachment 205637 [details] [review]:

That's not the right approach. gnome-settings-daemon set this variable for us, we just have to make sure all our formats are localized.
Comment 20 Guillaume Desmottes 2012-01-20 10:33:00 UTC
(In reply to comment #17)
> I may be missing something here, but how is %H:%M supposed to change to %I.%M?

You're right, the right fix is to use a localized string. As there is no equivalent (bug #668323) we'll have to use %X for now.
Comment 21 Guillaume Desmottes 2012-01-20 10:39:23 UTC
Created attachment 205689 [details] [review]
Use a localized format when displaying times

Unfortunatelly there is no localized format displaying only the hour and
minutes (bug #668323) so we'll have to use %X for now which also display the
seconds.

EMPATHY_DATE_FORMAT_DISPLAY_SHORT was already localized so this one is fine.

That also means we don't have to translate those formats any more as we'll
just rely on the system env.
Comment 22 Xavier Claessens 2012-01-20 10:42:01 UTC
Looks better to me :)

+1
Comment 23 Guillaume Desmottes 2012-01-20 10:42:05 UTC
Created attachment 205690 [details]
test script

For the record, here is the small script I wrote to test formats.
Comment 24 Guillaume Desmottes 2012-01-20 10:43:31 UTC
Attachment 205689 [details] pushed as 7d6b479 - Use a localized format when displaying times
Comment 25 William Jon McCann 2012-01-20 13:50:52 UTC
So the format will change when I use the 12/24 hour switch in the Date and Time settings panel, right?
Comment 26 Guillaume Desmottes 2012-01-25 15:50:17 UTC
(In reply to comment #25)
> So the format will change when I use the 12/24 hour switch in the Date and Time
> settings panel, right?

We rely on the system localization of the "%X" format which depends of the local settings (like LC_TIME). Those locales can be configured using gnome-control-center's language panel. Not sure if that's the same as the 12/24 setting.
Comment 27 William Jon McCann 2012-01-25 16:38:58 UTC
That isn't the same iirc. It needs to follow the 12/24 setting.
Comment 28 Guillaume Desmottes 2012-01-30 14:14:22 UTC
Why do we have 2 settings for this? Isn't the point of the region panel to configure exactly that?
Comment 29 Guillaume Desmottes 2012-01-30 16:15:44 UTC
Jon: I don't mind you re-opening the bug but please clarifiy the different settings as well.

We have at least 2 settings here:

"org.gnome.system.locale region" which is set in the "Region and Language / Formats" panel.
gnome-session reads this setting and set LC_TIME accordingly. Once set, localized strftime formats are automatically localized.

"org.gnome.desktop.interface clock-format" which is set in the "Date and Time" panel and seems specific to gnome-shell's clock.

From my understanding, the former is more general and should be the one app should rely on. Actually, one may claim that the latter should be implicit and derivated from the former.
Comment 30 William Jon McCann 2012-01-30 16:42:44 UTC
Sorry, I have no idea about the dconf settings. From the user's perspective the times used on the system should follow the 12/24 switch in the Date and Time settings panel.

I imagine the locale would provide the default setting for the 12/24 switch and the user would be able to change it as needed.
Comment 31 Bastien Nocera 2012-01-30 17:09:27 UTC
The point is that the preference should override the locale-provided data. You will display the time (or more likely, date) in a particular language.

The user wants to be able to choose whether to use 12 or 24 hour format. That's independent of the locale.

It's also very important for some locales where the usage is very dependent on the person's role, or upbringing.
Comment 32 Guillaume Desmottes 2012-03-12 09:17:16 UTC
(In reply to comment #30)
> Sorry, I have no idea about the dconf settings. From the user's perspective the
> times used on the system should follow the 12/24 switch in the Date and Time
> settings panel.
> 
> I imagine the locale would provide the default setting for the 12/24 switch and
> the user would be able to change it as needed.

So yeah, the current situation is pretty confusing; I opened bug #671870
Comment 33 GNOME Infrastructure Team 2018-05-22 14:00:07 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/empathy/issues/179.