Page MenuHomePhabricator

Wikibase Doesn't Fully Support ISO 8601 Timestamps (Fractional Seconds)
Closed, DuplicatePublic

Description

When trying to add a reference to a wikidata claim (via some hand-crafted js hitting the API endpoint directly) I get the error:

{"error":{"code":"modification-failed","info":"Data value corrupt: $timestamp must resemble ISO 8601, given +2020-03-07T00:00:00.000Z","messages":[{"name":"wikibase-validator-bad-value","parameters":["$timestamp must resemble ISO 8601, given +2020-03-07T00:00:00.000Z"],"html":{"*":"Data value corrupt: $timestamp must resemble ISO 8601, given +2020-03-07T00:00:00.000Z"}}],"*":"See https://www.wikidata.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes."},"servedby":"mw1358"}

But +2020-03-07T00:00:00.000Z is a valid ISO 8601 timestamp (minus the "+" sign).

When I strip the ".000" from the date string then the request succeeds.

Event Timeline

Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald Transcript

I don't think this ticket is a duplicate of that one. I'm not asking for more precise time. I'm asking for the parser to be more forgiving before truncating the time to a day.