Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly disallow year 0 #1000

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion toml.abnf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down