Dates: date ranges

date phrase-level encoding
date dateRange

Encoding date ranges using the date element rather than dateRange

Date ranges can be expressed in several ways using the TEI. In a sense, the imprecise dates discussed in Dates: format for the value and when attributes constitute a kind of date range, in that they represent a span of time (e.g. an entire century). However, they do so not by identifying its endpoints, but by expressing the date at a higher level of generality. For some purposes, this is effective: for instance, if a text names an entire century (the 20th century), that span of time may be encoded using P4 as <date value="19">the 20th century</date>. But if the text names an equally vague span that does not correspond to a standard unit of time measurement (the Victorian era), this method is inappropriate.

Date ranges in P4

In P4, the dateRange element is provided as a more explicit way of encoding date ranges, and it is available in all vanilla TEI DTDs. It provides two attributes, from and to, which allow you to identify the start and ending points for the date range. We recommend that these be captured using the ISO 8601 format described in Dates: format for the value and when attributes.

If one or both of the endpoints is known to be exact, the exact attribute could be used to indicate this: for instance, <dateRange exact="from" from="1899-08-31" to="1899-10-01">From August 31, 1899, till about the 1st of October</dateRange>. Values for this attribute are from (the from date is exact), to (the to date is exact), both (both dates are exact), and none (neither date is exact). The use of the exact attribute implies that any endpoint not designated as exact should be assumed to be inexact. The exact attribute is chiefly useful in indicating vagueness or expressions of uncertainty in the source, for instance words like about or near, as in the example above. There is no need for the exact attribute if you can use an imprecise date value instead. For instance, from May 1899 to August 1899 could be encoded as dateRange from="1899-05" to="1899-08", indicating that only the month is known.

Date ranges can also be encoded using the simple date element, since ISO 8601 provides a format for representing ranges, as described in Dates: format for the value and when attributes. However, the explicit separation of start and ending points (using from and to on dateRange) may make this information easier to process, particularly if you are using date information to generate a timeline or to sort entries. Using dateRange also may be easier if the start and ending point are at different levels of precision. For this reason we recommend the use of dateRange.

Where date ranges are expressed in prose within the text (for instance, it took from March 1, 1898 to January 23, 1899…), the entire phrase denoting the range should be encoded within dateRange.

Date ranges in P5

The encoding of date ranges in P5 is quite different from what is descsribed above, since in P5 date ranges are encoded using the date element; the P4 dateRange element is eliminated, but its from and to attributes are instead used on the date element. As with the P4 dateRange element, they are used to encode exact endpoints of a date range where these are known: the from attribute designates the start of the range and the to attribute designates the end. For ranges whose endpoints are not precisely known, two new attributes for date are introdcued: the notBefore attribute designates the earliest possible start date and the notAfter attribute designates the latest possible end point. An imprecise range of this kind may be used to indicate a single date that is known to fall somewhere between the endpoints, or a range of dates with fuzzy boundaries. The exact attribute provided in P4 is not available in P5.


Example 1 (P4)

Two different, but equivalent, ways to encode a date that refers to an entire date range:

<date value="1997-11-14/1997-11-16">November 14
	through 16, 1997</date>
<dateRange from="1997-11-14"
	to="1997-11-16">November 14 through 16,

Note: it is easier to migrate to P5 from the latter.

Example 1 (P5)

The same range, expressed in P5:

<date from="1997-11-14" to="1997-11-16">November
	14 through 16, 1997</date>

Example 2 (P4)

A date that refers to an entire date range, using from and to, with the exact attribute indicating that only the starting point is exact:

<dateRange exact="from" from="1899-08-31"
	to="1899-10-30">From August 31, 1899, till shortly before

Example 2 (P5)

A date that refers to an entire date range, using from and notAfter to indicate that only the starting point is exact:

<date from="1899-08-31"
	notAfter="1899-10-30">From August 31, 1899, till shortly
	before Halloween</dateRange>

Example 3 (P5)

A date that refers to one day within a range:

<date notBefore="1997-11-14"
	notAfter="1997-11-16">Between 14 and 16 November 1997,