Skip to content
EPUBCheck · Package document (OPF)

EPUBCheck OPF-054: invalid metadata date

Updated:

EPUBCheck OPF-054 is an error message: “Date value "…" is not valid as per http://www.w3.org/TR/NOTE-datetime:….” A date in the metadata is not a valid date. EPUBCheck quotes the value and the reason, and an invalid date is an error rather than a style warning.

The official message

Date value "%1$s" is not valid as per http://www.w3.org/TR/NOTE-datetime:%2$s.

Default severity
Error. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.
EPUBCheck version
5.4.0

%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.

Typical causes

  • Impossible dates such as 2020-13-01 or 2021-02-30.
  • Text that is not a date in a date field, such as "unknown" or "n/a".
  • Day and month swapped in an imported value.

How to fix it

  1. Find the date element EPUBCheck points to.
  2. Correct the value to a real date in YYYY, YYYY-MM or YYYY-MM-DD form.
  3. If the date is unknown, remove the element instead of filling it with placeholder text.

When it's not this

If the date is real but written in another format, that is OPF-053, a warning.

Terms used here

Other OPF messages

  • OPF-053 Date value "…" does not follow recommended syntax as per http://www.w3.org/TR/NOTE-datetime:….
  • OPF-055 … tag is empty.
  • OPF-050 TOC attribute references resource with non-NCX mime type; "application/x-dtbncx+xml" is expected.
  • OPF-049 Item id "…" was not found in the manifest.
  • OPF-048 Package tag is missing its required unique-identifier attribute and value.
  • OPF-060 Duplicate entry in the ZIP file: "…" (file names must be unique after Unicode canonical normalization and full case folding).

Sources

Message text and severity from EPUBCheck 5.4.0 (W3C, BSD-3-Clause). Explanation by EpubCC.

FAQ

What does EPUBCheck OPF-054 mean?

EPUBCheck OPF-054 is an error message: “Date value "…" is not valid as per http://www.w3.org/TR/NOTE-datetime:….” A date in the metadata is not a valid date. EPUBCheck quotes the value and the reason, and an invalid date is an error rather than a style warning.

Is OPF-054 an error?

OPF-054 is reported as error by default. The EPUB breaks a rule of the specification and is invalid. Stores and Send to Kindle may reject it, and EPUBCheck exits with status 1.