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

Year zero in ODTs, LDTs, and LDs may be disallowed #1016

Closed
wants to merge 4 commits into from
Closed
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 @@ -2,6 +2,7 @@

## unreleased

- Year `0000` may be disallowed in Date-Times and Dates.
- Clarify Unicode and UTF-8 references.
- Relax comment parsing; most control characters are again permitted.
- Allow newline after key/values in inline tables.
Expand Down
18 changes: 16 additions & 2 deletions toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,22 @@ time with a space character (as permitted by RFC 3339 section 5.6).
odt4 = 1979-05-27 07:32:00Z
```

One exception to RFC 3339 is permitted: seconds may be omitted, in which case
`:00` will be assumed. The offset immediately follows the minutes.
Contrary to RFC 3339, seconds may be omitted, in which case `:00` will be assumed. The
offset immediately follows the minutes.

```toml
odt5 = 1979-05-27 07:32Z
odt6 = 1979-05-27 07:32-07:00
```

Date-times in the year `0000` may throw errors for technical reasons. Although some
platforms may recognize year-zero date-times, for the sake of interoperability, avoid
using year-zero date-times in TOML documents.

```toml
odt_year1 = 0001-01-01 00:00:00Z # NOTE: Earliest date-time guaranteed to be valid.
```

Millisecond precision is required. Further precision of fractional seconds is
implementation-specific. If the value contains greater precision than the
implementation can support, the additional precision must be truncated, not
Expand All @@ -601,6 +609,9 @@ Seconds may be omitted, in which case `:00` will be assumed.
ldt3 = 1979-05-27T07:32
```

Date-times in the year `0000` may throw errors for technical reasons. Avoid them in TOML
documents.

Millisecond precision is required. Further precision of fractional seconds is
implementation-specific. If the value contains greater precision than the
implementation can support, the additional precision must be truncated, not
Expand All @@ -616,6 +627,9 @@ represent that entire day without any relation to an offset or timezone.
ld1 = 1979-05-27
```

Dates in the year `0000` may throw errors for technical reasons. Avoid them in TOML
documents.

## Local Time

If you include only the time portion of an
Expand Down