aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-contact-widget.c
diff options
context:
space:
mode:
authorPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-27 00:27:25 +0800
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>2009-05-28 00:52:08 +0800
commitcf198ce9b0834e4d2cf156f201c3fb77d17a1ce5 (patch)
tree715afa2868699d06b0cdc4101cbf6e70fd483445 /libempathy-gtk/empathy-contact-widget.c
parent3b2d620a1fb5ce624fbf330a96d76a0d6b563aaf (diff)
downloadgsoc2013-empathy-cf198ce9b0834e4d2cf156f201c3fb77d17a1ce5.tar
gsoc2013-empathy-cf198ce9b0834e4d2cf156f201c3fb77d17a1ce5.tar.gz
gsoc2013-empathy-cf198ce9b0834e4d2cf156f201c3fb77d17a1ce5.tar.bz2
gsoc2013-empathy-cf198ce9b0834e4d2cf156f201c3fb77d17a1ce5.tar.lz
gsoc2013-empathy-cf198ce9b0834e4d2cf156f201c3fb77d17a1ce5.tar.xz
gsoc2013-empathy-cf198ce9b0834e4d2cf156f201c3fb77d17a1ce5.tar.zst
gsoc2013-empathy-cf198ce9b0834e4d2cf156f201c3fb77d17a1ce5.zip
Use empathy_time_to_string_local
Diffstat (limited to 'libempathy-gtk/empathy-contact-widget.c')
-rw-r--r--libempathy-gtk/empathy-contact-widget.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c
index 5ccc4b009..9166a6546 100644
--- a/libempathy-gtk/empathy-contact-widget.c
+++ b/libempathy-gtk/empathy-contact-widget.c
@@ -21,10 +21,8 @@
#include <config.h>
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
-#include <time.h>
#include <gtk/gtk.h>
#include <glib/gi18n-lib.h>
@@ -41,6 +39,7 @@
#include <libempathy/empathy-contact-manager.h>
#include <libempathy/empathy-contact-list.h>
#include <libempathy/empathy-location.h>
+#include <libempathy/empathy-time.h>
#include <libempathy/empathy-utils.h>
#include "empathy-contact-widget.h"
@@ -1323,24 +1322,19 @@ contact_widget_location_update (EmpathyContactWidget *information)
gtk_label_set_markup (GTK_LABEL (information->label_location), _("<b>Location</b>"));
else
{
- gchar user_date [100];
+ gchar *user_date;
+ gchar *text;
gint64 stamp;
- struct tm *ptm;
time_t time;
stamp = g_value_get_int64 (value);
time = stamp;
- ptm = gmtime (&time);
- if (strftime (user_date, 100, _("%B %e, %Y at %R UTC"), ptm) > 0)
- {
- gchar *text;
- text = g_strconcat ( _("<b>Location</b> on "), user_date, NULL);
- gtk_label_set_markup (GTK_LABEL (information->label_location), text);
- g_free (text);
- }
- else
- gtk_label_set_markup (GTK_LABEL (information->label_location), _("<b>Location</b>"));
+ user_date = empathy_time_to_string_local (time, _("%B %e, %Y at %R"));
+
+ text = g_strconcat ( _("<b>Location</b> on "), user_date, NULL);
+ gtk_label_set_markup (GTK_LABEL (information->label_location), text);
+ g_free (text);
}
if (information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP ||