Dates: simple encoding

date calendar year month AD and BC dates Gregorian calendar phrase-level encoding
docDate dateRange date

Encoding dates using date and the value (P4) or when (P5) attribute

Dates may be encoded quite simply or in a great deal of detail. For most purposes, a simple encoding will provide enough information to allow for retrieval and analysis (such as generating timelines). In the TEI, the simple encoding consists of a date element with a value (P4) or when (P5) attribute. The date element can be used to encode any reference to a date, whether in an explicit date format (e.g. January 1, 2005; MMV (i.e. in Roman numerals)) or in a more verbose form (e.g. in the third year of Elizabeth’s reign). The value or when attribute provides a way of capturing a normalized date in a format that can be automatically processed. This regularization is very useful if you want to make the dates in your text searchable: for instance, if you are encoding a journal or other material with dated entries, and want users to be able to find entries that fall within a certain date range. Normalization is also useful for dates in Roman numerals, and for old-style dates (particularly if your project includes both old-style and new-style dates).

We recommend using the W3C date format for the value attribute (it is required for the when attribute); this format is discussed in more detail in Dates: format for the value and when attributes.