EPUBCheck OPF-053: date in nonstandard format
Updated:
EPUBCheck OPF-053 is a warning message: “Date value "…" does not follow recommended syntax as per http://www.w3.org/TR/NOTE-datetime:….” A date in the metadata does not follow the recommended W3C date and time format, so some apps may not read it. EPUBCheck quotes the value and the reason.
The official message
Date value "%1$s" does not follow recommended syntax as per http://www.w3.org/TR/NOTE-datetime:%2$s.
- Default severity
- Warning. The EPUB is still valid, but something is likely to cause problems in some reading apps. EPUBCheck exits with 0 unless you pass --failonwarnings.
- EPUBCheck version
- 5.4.0
%1$s, %2$s… are filled in with the file, value or element EPUBCheck found.
Typical causes
- Dates written as text or in local formats, such as "March 2020" or "03/15/2020".
- A date with a time but no time zone, or extra text after the date.
- Metadata imported from a system that uses another date format.
How to fix it
- Find the date element EPUBCheck points to (usually dc:date).
- Rewrite it as YYYY, YYYY-MM or YYYY-MM-DD, for example 2020-03-15.
- If you include a time, use the full form with a time zone, such as 2020-03-15T10:00:00Z.
When it's not this
If the value is not a real date at all, EPUBCheck reports OPF-054, an error.
Terms used here
Other OPF messages
OPF-054Date value "…" is not valid as per http://www.w3.org/TR/NOTE-datetime:….OPF-055… tag is empty.OPF-050TOC attribute references resource with non-NCX mime type; "application/x-dtbncx+xml" is expected.OPF-049Item id "…" was not found in the manifest.OPF-048Package tag is missing its required unique-identifier attribute and value.OPF-060Duplicate 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.