DEV Community

Cover image for EDTF, a way to deal with uncertain dates

EDTF, a way to deal with uncertain dates

Leo Botinelly
・2 min read

Working with digital humanities means delving into projects with a fair share of uncertain dates (e.g. "Spring, 1850") and periods ("starting possibly around 1860, ending January 1865").

I know what you're thinking, fellow architect/engineer/developer. Uuugh, I can't even imagine how to describe and query this.

Luckily, there's a standard for that. It's called EDTF (Extended Date/Time Format) and it is implemented over ISO 8601, the format ECMAScript - and, by extension, MongoDB - uses for date/time storage.

This is the basic ISO 8601 mask we all know and love:


Soothingly constant, right? Well, all the following are valid Level 1 EDTF strings:

  • 1964/2008 - interval beginning sometime in 1964, ending sometime in 2008
  • 2004-02-01/2005-02 - interval beginning on February 1, 2004 and ending February 2005
  • 1984? - possibly the year 1984, but not definitely
  • 1985-04/.. - interval starting at 1985 April, end open
  • 2001-21 - Spring, 2001

...yes, 21. The 21-24 code sequence refers to 'Spring', 'Summer', 'Autumn' and 'Winter'.

Level 2 ups the ante. Remember the 21 - Spring code? Well, it comes back with a vengeance, sporting beauties such as...

  • 1950-25 - Spring (Northern Hemisphere), 1950
  • 1950-29 - Spring (Southern Hemisphere), 1950
  • 1950S2 - some year between 1900 and 1999, estimated to be 1950
  • [1760-01,1760-02,1760-12..] - January or February of 1760 or December 1760 or some later month

If you want to read the full standard you're clearly a masochist. Oh, and here's the link.

Cover image: Old Calligraphy manuscript, Pikrepo

Discussion (0)