Smalyshev added a comment.

Proposed storage format for dates:

1. Dates are stored as long signed integers, representing number of seconds 
since 1970-01-01 00:00:00 UTC.
2. This gives us range of 292 bln years 
<http://www.wolframalpha.com/input/?i=9223372036854775807+seconds+in+years>.
3. When parsing the date, if they year is below 292000000 (by absolute value) 
we use Java functions, and hope they work right with the calendar, etc.
4. Beyond year 292M, we just count in whole years - i.e. the number stored is 
years*SECONDS_IN_YEAR

This allows us to keep reasonable accuracy (to the second range) within wide 
range of dates, while still preserving the sequence - i.e. the Big Bang can be 
listed as "even that happened before year 2000" - and keeping the single 
property and data format, so to avoid complicating the data handling code with 
special cases.

We would probably want to define helper functions to convert from dates to 
seconds and back, for convenience.


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

REPLY HANDLER ACTIONS
  Reply to comment or attach files, or !close, !claim, !unsubscribe or !assign 
<username>.

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

To: Smalyshev
Cc: Smalyshev, Manybubbles, GWicke, JanZerebecki, aude, Lydia_Pintscher, 
Eloquence, aaron, jkroll, Wikidata-bugs, daniel



_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to