GNOME Bugzilla – Bug 647877
fn:timezone-from-dateTime is not working
Last modified: 2011-06-01 06:57:08 UTC
OS: Ubuntu 11.04 GCC: 4.5.2 Tracker: 0.10.9 I can get max tracker:added value by the following query. SELECT MAX (?t) WHERE { ?u a nmm:MusicPiece; tracker:added ?t } And, to get value converted from xsd:dateTime string, I used following query. But, this query always return (null) . SELECT fn:timezone-from-dateTime (?t) WHERE { ?u a nmm:MusicPiece; tracker:added ?t }
We currently do not store timezone information for the internally updated tracker:added property. Do you have a use case for this?
I want to get newly add music file list from tracker-store. For that purpose, tracker:added value is appropriate. Following is my use case. First time, I stored the value "tracker:added" When new files are added, I'll receive GraphUpdate signal from tracker. Then, I'll use stored last "tracker:added" value to filter old files. And I will get newly added file lists. It is difficult to compare the value "tracker:added" because it is string not number. So I want to convert tracker:added value to number by using fn:timoezone-from-dateTime.
fn:timezone-from-dateTime just returns the UTC offset, not the whole date/time as a number. However, tracker returns standard ISO 8601 combined date/time strings (same as xsd:dateTime), and there are tons of parsers for this. You could, e.g., use g_time_val_from_iso8601 from GLib. At the moment, tracker always returns date/time strings in UTC. This has the nice side-effect that you could even use regular string comparison to compare date/time strings. Please note that this could change in a future version of tracker, though. We guarantee only that it's a valid ISO 8601 / xsd:dateTime value.
Thank you! My problem is solved. :)