diff --git a/CHANGELOG.md b/CHANGELOG.md index 14d3cebc..b7e346e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - Seconds in Date-Time and Time values are now optional. - Allow non-English scripts in unquoted (bare) keys - Clarify newline normalization in multi-line literal strings. +- Explicitly disallow year zero. ## 1.0.0 / 2021-01-11 diff --git a/toml.abnf b/toml.abnf index 0446f8b6..dedc4ee4 100644 --- a/toml.abnf +++ b/toml.abnf @@ -177,7 +177,7 @@ false = %x66.61.6C.73.65 ; false date-time = offset-date-time / local-date-time / local-date / local-time -date-fullyear = 4DIGIT +date-fullyear = 4DIGIT ; 0001-9999 date-month = 2DIGIT ; 01-12 date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on month/year time-delim = "T" / %x20 ; T, t, or space diff --git a/toml.md b/toml.md index 08cc9f67..9b5b3dfd 100644 --- a/toml.md +++ b/toml.md @@ -582,6 +582,13 @@ implementation-specific. If the value contains greater precision than the implementation can support, the additional precision must be truncated, not rounded. +The first year in the Gregorian calendar is year 1 (1 BC is followed by 1 AD), +and year 0 is not allowed: + +``` +odt7 = 0000-01-01 07:32:32Z # INVALID +``` + ## Local Date-Time If you omit the offset from an [RFC 3339](https://tools.ietf.org/html/rfc3339)