[tracker] libtracker-sparql: Fix bad serialization of date/time values
- From: Sam Thursfield <sthursfield src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-sparql: Fix bad serialization of date/time values
- Date: Fri, 20 Jan 2017 13:18:34 +0000 (UTC)
commit f7292146ddc213ec0f74688946339040ac98daef
Author: Sam Thursfield <sam afuera me uk>
Date: Fri Jan 20 13:14:14 2017 +0000
libtracker-sparql: Fix bad serialization of date/time values
TrackerResource was creating bad SPARQL & Turtle from GDateTime values.
If you saw this...
GDBus.Error:org.freedesktop.Tracker1.SparqlError.Type: Not a ISO
8601 date string. Allowed form is [-]CCYY-MM-DDThh:mm:ss[Z|(+|-)hh:mm]
...it's because in the arguments for g_date_time_format() I confused %S
(seconds since the last minute) with %s (seconds since 1st January
1970). That's a lot of extra seconds.
src/libtracker-sparql/tracker-resource.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-sparql/tracker-resource.c b/src/libtracker-sparql/tracker-resource.c
index 7f9ef92..8876cd6 100644
--- a/src/libtracker-sparql/tracker-resource.c
+++ b/src/libtracker-sparql/tracker-resource.c
@@ -1091,7 +1091,7 @@ generate_turtle_value (const GValue *value,
} else if (type == G_TYPE_DATE_TIME) {
char *datetime_string;
datetime_string = g_date_time_format (g_value_get_boxed (value),
-
"\"%Y-%m-%dT%H:%M:%s%z\"^^<http://www.w3.org/2001/XMLSchema#dateTime>");
+
"\"%Y-%m-%dT%H:%M:%S%z\"^^<http://www.w3.org/2001/XMLSchema#dateTime>");
g_string_append (string, datetime_string);
g_free (datetime_string);
} else if (type == G_TYPE_DOUBLE || type == G_TYPE_FLOAT) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]