Alphos added a comment.

It's weirder than you think :

SELECT ?now WHERE {
  BIND( ( NOW() - "P7D"^^xsd:duration ) AS ?now ) .
}

returns "Sep 1, 2016", which is 6 days from today (we're 2016-08-25T23:55:00.000+02:00, give or take a few minutes)

SELECT ?now WHERE {
  BIND( ( "2016-08-26T00:13:14.567Z"^^xsd:dateTime - "P7D"^^xsd:duration ) AS ?now ) .
}

returns "Sep 2, 2016".

Same goes for all values of date and time, including time values such as [...]T00:13:14.567Z, [...]T12:13:14.567Z, [...]T23:13:14.567Z to account for my timezone not being Zulu (I'm currently UTC+02:00) : all these subtractions of 7-day xsd:duration actually add 6 days, for some reason.

I'd look in the - operator implementation for xsd:dateTime and xsd:duration entities ;-)


TASK DETAIL
https://phabricator.wikimedia.org/T143897

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Alphos
Cc: Smalyshev, Alphos, WikidataFacts, Aklapper, Sylvain_WMFr, mschwarzer, Avner, debt, Gehel, D3r1ck01, Jonas, FloNight, Xmlizer, Izno, jkroll, Wikidata-bugs, Jdouglas, aude, Deskana, Manybubbles, Mbch331
_______________________________________________
Wikidata-bugs mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to