]> git.0d.be Git - empathy.git/commitdiff
Use g_date_time_new_from_unix_local() to read timestamps from logger
authorDanielle Madeley <danielle.madeley@collabora.co.uk>
Wed, 31 Aug 2011 03:13:16 +0000 (13:13 +1000)
committerDanielle Madeley <danielle.madeley@collabora.co.uk>
Wed, 31 Aug 2011 03:13:16 +0000 (13:13 +1000)
g_date_time_new_from_unix_local() reads a Unix timestamp (which is defined
to be in UTC) and sets the timezone for the GDateTime to be the local timezone.
Thus when we format it, we get times in local time.

g_date_time_new_from_unix_utc() is not correct, because it sets the timezone
to UTC.

Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=656189
libempathy-gtk/empathy-log-window.c

index 6cdf22292f81e7e9cc80475b194cc29f36ae727d..816013b735ab9cfba5694c9b32b737987f2bc612 100644 (file)
@@ -1200,7 +1200,7 @@ get_parent_iter_for_message (TplEvent *event,
       GDateTime *date;
       gchar *body, *pretty_date;
 
-      date = g_date_time_new_from_unix_utc (
+      date = g_date_time_new_from_unix_local (
           tpl_event_get_timestamp (event));
 
       pretty_date = g_date_time_format (date,
@@ -1270,7 +1270,7 @@ log_window_append_chat_message (TplEvent *event,
   EmpathyStringParser *parsers;
   GString *msg;
 
-  date = g_date_time_new_from_unix_utc (
+  date = g_date_time_new_from_unix_local (
       tpl_event_get_timestamp (event));
 
   pretty_date = g_date_time_format (date, "%X");
@@ -1347,7 +1347,7 @@ log_window_append_call (TplEvent *event,
         }
     }
 
-  started_date = g_date_time_new_from_unix_utc (
+  started_date = g_date_time_new_from_unix_local (
       tpl_event_get_timestamp (event));
 
   pretty_date = g_date_time_format (started_date,