diff options
Diffstat (limited to 'gdata/gdata-parser.c')
-rw-r--r-- | gdata/gdata-parser.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/gdata/gdata-parser.c b/gdata/gdata-parser.c index a43c2ecf..74871c73 100644 --- a/gdata/gdata-parser.c +++ b/gdata/gdata-parser.c @@ -241,11 +241,29 @@ gchar * gdata_parser_int64_to_iso8601 (gint64 _time) { GTimeVal time_val; + gchar *iso8601; + gchar **date_time_components; + gchar *retval; time_val.tv_sec = _time; time_val.tv_usec = 0; - return g_time_val_to_iso8601 (&time_val); + iso8601 = g_time_val_to_iso8601 (&time_val); + + /* FIXME: Work around for Google's incorrect ISO 8601 implementation. + * They appear to not like dates in the format ā2014-08-09T21:07:05Zā + * which specify a timezone using āZā and no microseconds. + * + * See: https://bugzilla.gnome.org/show_bug.cgi?id=732809 + * https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3595 + * http://stackoverflow.com/a/17630320/2931197 */ + date_time_components = g_strsplit (iso8601, "Z", 2); + retval = g_strjoinv (".000001+00:00", date_time_components); + g_strfreev (date_time_components); + + g_free (iso8601); + + return retval; } gboolean |