EDTF is a Value that holds dates such as year or month precision, BCE, uncertain dates, and intervals as an ISO 8601-2 extended date string (Codec 0x06EL/0x06FL).

ItemValue
NameEDTF (even/odd pair; the names per code are in the member table below)
TAG ID0x06EL, 0x06FL
Section3 0011 (Value), offset C within the section = 14 to 15
KindValue · family: TIME
Index descriptionEDTF (ISO 8601-2) date string. Even and odd byte counts. A date that can be written with GREGORIAN-DATE is not written this way
Hugo sidevalue/time/edtf.md

Members

This page covers the two codes of the even/odd pair together. The even code is for values with an even number of bytes, and the odd code for an odd number (Record and TAG WORD). There is one codec document per code. The fields of the two codec documents are the same; only the DECLARE target and the name (BIND) differ.

TAG IDNameByte countCodec IDSpec documentTAG WORD
0x06ELEDTF-EVENeven0x000006E00x00000000/codecs/0x000006E0/0000 0110 1110 LLLL
0x06FLEDTF-ODDodd0x000006F00x00000000/codecs/0x000006F0/0000 0110 1111 LLLL

Fields (spec document)

The order of FIELDs in the document is the order of the Payload fields (Codec spec document).

OrderField (BIND)FIELDWidthReceiving format (CODEC)ENUM
1bytes#2remaining raw value (0xFFFF)

EDTF is a Value that holds a date as an Extended Date/Time Format (Library of Congress, ISO 8601-2:2019) string. It represents precision coarser than a day, BCE, uncertain, approximate, or partly unknown dates, and intervals.

Layout

  • Code: direct Value code 0x06EL (even bytes) and 0x06FL (odd bytes). Family TIME. The Payload is a string, but it is placed in the TIME family.
  • The byte count is determined by the least significant bit of the Codec and the Payload WORD count. It is 2 × Payload WORD count − least significant bit, and no Byte Count is stored (Value).
TAG WORD          0000 0110 111P LLLL      Codec 0x06EL/0x06FL (P = odd bytes)
[Length extension TAG] when the total is 15 WORD or more
Payload WORD 1st ... Nth          ASCII bytes of the EDTF string / last 0x00 if odd

Interpretation and validity

  • The byte sequence is an ASCII string that follows the EDTF Level 0, 1, and 2 grammar. An empty string is invalid.
  • Examples: day 1952-03-11, month 1952-03, year 1952, decade 195X, 44 BCE -0043, uncertain 1974?, approximate ~1974, interval 1952/2001, large year Y-13799999999.
  • Years are in the ISO 8601 astronomical style. 0000 is 1 BCE and -0043 is 44 BCE. When converting from historical notation, shift by one year.
  • It is the Gregorian calendar. EDTF does not handle other calendars. The original notation of other calendars such as the Julian calendar is preserved with GEDCOM-DATE. The value of the same day or period converted to the Gregorian calendar can be written with EDTF or GREGORIAN-DATE.
  • Canonical form: a date that can be written exactly with GREGORIAN-DATE, that is, [-]YYYY-MM-DD with no qualifier (?, ~, %), unknown digit (X), interval, or Y prefix, is written with GREGORIAN-DATE. Writing such a date with EDTF is invalid. The same day must be written in only one format so that it can be indexed and compared as time.
  • The schema does not yet check the EDTF grammar. The producer checks with an EDTF parser. Example: parser.ParseString of github.com/sfomuseum/go-edtf (BSD-3-Clause). Do not use parser.IsValid, because it looks at the grammar only and lets 2023-02-29 and 1974-13 pass. This parser does not yet support Y-prefixed years.

Length

  • The total is the WORD count of the TAG 1 WORD, the Length extension TAG (if any), and the Payload (Length).

Examples

DateBytesTotal WORD
19744 (even)06E2 3139 3734
197X4 (even)06E2 3139 3758
1952-037 (odd)06F4 3139 3532 2D30 3300

Standards basis

Open problems

  • The EDTF grammar check of the validator (whether the validator will rely on an external library).
  • The rule for carrying Wikidata century and millennium precision as EDTF unknown digits.

Related pages

Spec document source

This is the spec document 0x00000000/codecs/0x000006E0/latest.geul as read with geul show (hexadecimal in uppercase).

SPEC-VERSION 0x0001
DOC-ID 0x042600000000000006E000000000
BODY
#1 DECLARE 0x06E0
#2 FIELD #1 rest
#3 BIND #1 "EDTF-EVEN"
#4 BIND #2 "bytes"

The above is the codec document of EDTF-EVEN (0x06EL). The codec document of the other member (EDTF-ODD) differs only in the codec ID of the DOC-ID, the DECLARE target, and the name (BIND) bound in #1.