Skip to content
TEI & XML Encoding

To encode an uncertain date in TEI, keep the human-readable text as the element's content and add machine-readable attributes that express the uncertainty: @notBefore/@notAfter for a date known only within bounds, @from/@to for a span an event occupied, and @cert or a certainty element to record your confidence. The principle is to make "circa" and "probably" queryable without pretending you know more than you do.

Which attribute fits which kind of uncertainty? ​

Choosing the right attribute is the whole skill. They are not interchangeable:

You knowUseExample
The exact date@whenwhen="1841-06-07"
A span the event occupied@from / @toa reign, a war, a tenure
A single date, only its bounds@notBefore / @notAfter"sometime in the 1840s"
One bound only@notBefore or @notAfter alone"after 1850"

The most common mistake is using @from/@to for an unknown single date. A birth happened on one day; "between 1845 and 1850" is @notBefore/@notAfter, not a five-year span the birth "lasted".

How do you encode "circa 1850"? ​

Keep the source wording, add a defensible window, and flag the confidence:

xml
<date notBefore="1845" notAfter="1855" cert="medium">circa 1850</date>

Decide your window size as a project rule — many historians treat "circa" as plus or minus five years — and document it in encodingDesc so every encoder uses the same span. Consistency here is what makes cross-collection date queries trustworthy.

How do you record genuine confidence levels? ​

For a quick flag, @cert="high|medium|low" is enough. When you need precision, use the standalone certainty element pointing back at the date:

xml
<date xml:id="d1" notBefore="1820" notAfter="1830">in his youth</date>
<certainty target="#d1" locus="value" degree="0.7"
  assertedValue="1825">
  <desc>Estimated from the subject's likely age in the portrait.</desc>
</certainty>

This separates the date markup from the reasoning, and @degree="0.7" gives downstream analysis a numeric confidence it can filter on. Use precision instead when the issue is granularity (year vs day), not doubt.

What date format must the attributes use? ​

All standard date attributes expect ISO 8601 / W3C values: YYYY, YYYY-MM or YYYY-MM-DD. A few rules that save grief:

  • notBefore="1840" is valid; notBefore="1840s" is not.
  • For "19th century", use notBefore="1800" notAfter="1899".
  • For BCE or non-Gregorian dates, use @when-custom with a declared @datingMethod rather than forcing them into ISO.
xml
<date when-custom="1.15.4.3.2" datingMethod="#maya-long-count">
  Maya Long Count date
</date>

A reusable end-to-end workflow ​

Here is a workflow you can apply to a whole archive:

  1. Transcribe the date as written — never normalise away "Lady Day 1750".
  2. Classify the uncertainty — exact, span, or bounded-unknown — and pick the attribute from the table above.
  3. Set a documented window for vague terms like "early", "circa", "before".
  4. Flag confidence with @cert, escalating to certainty where the reasoning matters.
  5. Validate that every @notBefore is not after its @notAfter (a Schematron check catches reversed bounds).
  6. Record the conventions in encodingDesc so the rules outlive any single encoder.

How do you keep dates consistent across a team? ​

The threat to a date corpus is drift: one encoder reads "circa" as plus or minus two years, another as ten. Lock the policy down in two places — a written rule in the header and an enforced rule in your ODD/Schematron. A Schematron assertion that flags @notBefore > @notAfter and another that warns when cert="low" lacks a certainty explanation turns good intentions into automatic gatekeeping.

Key Takeaways ​

  • Keep the original date text as content; express uncertainty in machine-readable attributes.
  • @notBefore/@notAfter is for a single unknown date within bounds — not @from/@to.
  • Encode "circa" as a documented window plus @cert, with the window size fixed as a project rule.
  • Use @cert for quick flags and the certainty element with @degree for reasoned confidence.
  • All standard date attributes need ISO 8601 values; use @when-custom for other calendars.
  • Enforce sane bounds and documented conventions with Schematron and encodingDesc.

Frequently Asked Questions ​

How do I encode an approximate date in TEI? ​

Put a machine-readable value in @when-iso and flag the approximation. Use @notBefore/@notAfter for a range, or @from/@to for a span, and add cert="low" or a precision element when you want to record how confident you are.

What is the difference between when, from/to and notBefore/notAfter? ​

@when is a single known point. @from/@to mark a span the event actually occupied (a reign, a war). @notBefore/@notAfter mark the boundaries within which a single unknown date must fall — the right choice for genuine uncertainty.

How do I record a date like 'circa 1850'? ​

Encode the text 'circa 1850' as content and set @notBefore="1845" @notAfter="1855" (or your chosen window) plus cert="medium". The window makes 'circa' queryable; document the window size you use as a project rule.

Can I express how confident I am about a date? ​

Yes. Use @cert with high, medium or low for a quick flag, or the standalone certainty element with @degree for a precise numeric confidence and a @target pointing at the date. precision records granularity rather than confidence.

Which date format should TEI date attributes use? ​

Use ISO 8601 / W3C dates: YYYY, YYYY-MM, or YYYY-MM-DD in @when, @notBefore, etc. For dates beyond the Gregorian range or in other calendars, use @when-custom with a declared @datingMethod.

How do I encode a date only known to a decade or century? ​

Use the coarsest ISO value you can defend — a bare @when="18" is not valid, so use @notBefore="1800" @notAfter="1899" for "the 19th century", and add a precision element if you want to label the granularity explicitly.