After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 647877 - fn:timezone-from-dateTime is not working
fn:timezone-from-dateTime is not working
Status: RESOLVED NOTABUG
Product: tracker
Classification: Core
Component: General
0.10.x
Other Linux
: Normal normal
: ---
Assigned To: tracker-general
Jamie McCracken
Depends on:
Blocks:
 
 
Reported: 2011-04-15 15:48 UTC by Simon Hong
Modified: 2011-06-01 06:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon Hong 2011-04-15 15:48:56 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 }
Comment 1 Jürg Billeter 2011-05-30 13:57:19 UTC
We currently do not store timezone information for the internally updated tracker:added property. Do you have a use case for this?
Comment 2 Simon Hong 2011-05-31 07:20:58 UTC
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.
Comment 3 Jürg Billeter 2011-05-31 10:10:04 UTC
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.
Comment 4 Simon Hong 2011-06-01 06:11:08 UTC
Thank you!
My problem is solved. :)