[telepathy-gabble/master] Fix a timezone issue with regards to the received time from the server.

Pierre-Luc Beaudoin pierre-luc.beaudoin at collabora.co.uk
Tue May 26 12:19:02 PDT 2009


The time is always UTC.
---
 src/conn-location.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/conn-location.c b/src/conn-location.c
index cf61a08..65eb7fb 100644
--- a/src/conn-location.c
+++ b/src/conn-location.c
@@ -329,15 +329,13 @@ update_location_from_msg (GabbleConnection *conn,
         }
       else if (strcmp (key, "timestamp") == 0)
         {
-          struct tm ptm;
-          gchar * p = strptime (str, "%Y%m%dT%T", &ptm);
-          if (p != NULL)
+          GTimeVal timeval;
+          if (g_time_val_from_iso8601 (str, &timeval))
             {
-              gint64 stamp = mktime (&ptm);
               value = g_slice_new0 (GValue);
               g_value_init (value, G_TYPE_INT64);
-              g_value_set_int64 (value, stamp);
-              DEBUG ("\t - %s: %" G_GINT64_FORMAT, key, stamp);
+              g_value_set_int64 (value, timeval.tv_sec);
+              DEBUG ("\t - %s: %s", key, str);
             }
           else
             {
-- 
1.5.6.5




More information about the telepathy-commits mailing list