Skip to content

dates

The two values an EDF start date takes when the real date is not known.

A recording's start is stored as a full timestamp, so a recording without a date still carries one. Two spellings mean "unknown", and readers must recognise both:

  • 1900-01-01, which the header parser gives a recording whose header carries no usable start date at all. Its time of day is not usable either.
  • 1985-01-01, EDF+'s own marker for an unknown or removed start date, spelled 01.01.85 in the header. EDF+ removes the date and keeps the time of day, so the time stays meaningful.

EDF_UNKNOWN_START_DATE = date(1985, 1, 1) module-attribute

EDF+'s marker for an unknown or removed start date, 01.01.85 in the header.

NO_HEADER_DATE_YEAR = 1900 module-attribute

The year the header parser gives a recording whose header carries no usable date.

parse_edf_start_date(start_date)

Parse the dd.mm.yy start date field of an EDF header.

The two-digit year is read as the most recent year that is not in the future: 68 is 1968, not 2068. 01.01.85 therefore parses as 1985-01-01, which is also EDF+'s marker for an unknown date; the two are spelled identically, so the parser cannot tell them apart and does not try. :data:EDF_UNKNOWN_START_DATE lets a reader recognise it.

Parameters:

Name Type Description Default
start_date str

The field's text, e.g. "12.10.26".

required

Returns:

Type Description
date | None

The date, or None if the field is not a valid date.

parse_edf_start_time(start_time)

Parse the hh.mm.ss start time field of an EDF header.

Parameters:

Name Type Description Default
start_time str

The field's text, e.g. "22.30.00".

required

Returns:

Type Description
time | None

The time, or None if the field is not a valid time.