This page explains and demonstrates one approach to handling and displaying dates using various date-related properties. Dates can be those of birth and death, and start dates and end dates of events.
 Multiple annotations for one property
In order to have a link to the year page a relation can be used for the year. When a month is available, or a month and a day, this additional info can be put in an attribute (to avoid duplication in query results, the year is not put in the attribute). Furthermore we may use an additional attribute as sortkey, explained below.
Start of events:
End of events:
 Sorting with special sortkey attribute
If, for sorting by date, as well as selection using inequalities, we use an attribute of type:date, e.g. Property:Date of birth, the table is restricted to events for which the full date is available, and for which the date is in the date range of type "date" (see below).
Alternatively we can use an attribute of type:string as common sortkey for a mix of full dates, year/month combinations and just years, positioning a year at the beginning of that year, and a month at the beginning of that month.
Taking into account the ASCII order, of which is relevant here the order " !-.0123456789:", a possible convention is as follows. With MM and MM-DD depending on the available data, the sortkey is of the form:
For years 0 through 9999 ("YYYY" implies padding with zeros for numbers less than 1000):
- YYYY-MM-DD (hence just like Type:Date, but for the range 0 through 9999)
For years -1e100 through -1:
where the year is equal to - ( 10 - number ) × 10 ^ ( 99 - EE ), where EE denotes a 2-digit integer, and number is a real number, 0 < number <= 9; for number < 1 a zero is written before the decimal point; a comma as digit separator is not used.
Example: year -9350 has sortkey "!96-0.65".
For years 1e4 through 1e100-1 use scientific notation starting with the e-part:
- eEE number-MM-DD
- eEE number-MM
- eEE number
where the year is equal to number × 10 ^ EE, where EE denotes a 2-digit integer >= 04, and number is a real number, 1 <= number < 10; a comma as digit separator is not used.
Example: year 12345 is written "e04 1.2345".
To allow a selection " < year ", we write a year without month or day with "!" at the end; e.g. "before 2006" can then be written "<=2006".
Alternatively, the hyphens between year and month and between month and day could be dispensed with. Multiple conventions should not be mixed within one wiki.
Because of the "odd" way of representing negative years this attribute is usually for selection and sorting only, not for display.
Births, using Property:Date of birth sortkey:
Events, using Property:start date sortkey:
 Sorting with special sortkey attribute of type integer
 Sorting without special sortkey attribute
If, for sorting by date, as well as selection using inequalities, we use an attribute of type:date, e.g. Property:Date of birth, the table is restricted to events for which the full date is available, and for which the date is in the date range of type "date".
<ask sort="date of birth">+The date "+" was not understood.The date "+" was not understood. *The date "*" was not understood.The date "*" was not understood.*"*" is not a number.*The date "*" was not understood.The date "*" was not understood.</ask>
Events for which only the year is known and events outside the date range of type "date" have to be supplied in a separate table or list. To allow this while avoiding duplication, a complication is that the software does not allow a "not" operator to deselect what was selected in the first table.
For years fully outside the date range we can use an inequality on the year Property:
This table can be put before the other table, to have a correct overall order, albeit that the two tables are not integrated.
For the remaining events (in this case: persons) we can use category:person for whom the date of birth is not available:
 Sorting alphabetically by year
If we do not want to use multiple properties for the same data, we have to choose between an attribute, which does not provide a link, and using a relation, which only allows alphabetical sorting:
- years in the range 1000 - 9999 are sorted correctly among themselves
- years in the ranges 100 - 999, 10 - 99, and 0 - 9 each ditto, but all interspersed
- negative years are correctly before 0 and positive years, but:
- years in the range -9999 through -1000 are sorted in reverse order among themselves
- years in the ranges -999 through -100, -99 through -10, and -9 through -1 each ditto, but all interspersed
Also, selection with inequalities is not possible.