[gnome-logs/wip/field-length: 4/4] Use locale format when displaying event timestamp



commit 193eafff93e5fc8fcb59fa473fb6f24a5f6a2bb4
Author: David King <davidk gnome org>
Date:   Wed Oct 23 20:26:32 2013 +0100

    Use locale format when displaying event timestamp
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710728

 src/gl-util.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gl-util.c b/src/gl-util.c
index 1db8f67..210568b 100644
--- a/src/gl-util.c
+++ b/src/gl-util.c
@@ -34,6 +34,7 @@ gchar *
 gl_util_timestamp_to_display (guint64 microsecs)
 {
     GDateTime *datetime;
+    GDateTime *local;
     gchar *time = NULL;
 
     datetime = g_date_time_new_from_unix_utc (microsecs / G_TIME_SPAN_SECOND);
@@ -44,9 +45,11 @@ gl_util_timestamp_to_display (guint64 microsecs)
         goto out;
     }
 
-    /* TODO: Localize? */
-    time = g_date_time_format (datetime, "%F %T");
+    local = g_date_time_to_local (datetime);
+    time = g_date_time_format (local, "%c");
+
     g_date_time_unref (datetime);
+    g_date_time_unref (local);
 
     if (time == NULL)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]