Last modified: 2014-07-18 10:14:27 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T67267, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 65267 - Specify whether TimeValue stores timestamps in UTC or local time.
Specify whether TimeValue stores timestamps in UTC or local time.
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
u=dev c=backend p=0
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-13 17:07 UTC by Daniel Kinzler
Modified: 2014-07-18 10:14 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Daniel Kinzler 2014-05-13 17:07:10 UTC
TimeValue has a time field and a timezone field. AS per [1], the time field is defined to be in ISO 8601 format, (which, per spec, includes a time zone offset). The current code of TimeValue and related classes expects the ISO time string to always end in Z, indicating the time is in UTC. So, the local time actually represented by the TimeValue would be the timestamp plus the minutes in the timezone field. The corresponding conversion has to be done by all parsers and formatters.

It would probably be easier (and more consistent with out handling of quantities) to store the time as an ISO date in the time zone specified by the user, so the timezone field would only be needed to derive the UTC time (which we really need only to build the query index). This would mean much fewer occasions that require conversion, and would thus be less error prone and easier to maintain. It would also be consistent with the idea to "save what the source sais". 

If we go that route, we should remove the time zone info from the time field of TimeValue, and rely on the separate timezone field to provide an offset. We could even have a special value there (e.g. false) for indicating an unknown time zone (would be treated like UTC for conversion, but not for display).


[1] https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links