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

Make seconds optional in Date-Time and Time #894

Merged
merged 4 commits into from
Jul 30, 2022
Merged
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 @@ -7,6 +7,7 @@
* Clarify where and how dotted keys define tables.
* Add new `\e` shorthand for the escape character.
* Add \x00 notation to basic strings.
* Seconds in Date-Time and Time values are now optional.
eksortso marked this conversation as resolved.
Show resolved Hide resolved

## 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 @@ -176,7 +176,7 @@ time-secfrac = "." 1*DIGIT
time-numoffset = ( "+" / "-" ) time-hour ":" time-minute
time-offset = "Z" / time-numoffset

partial-time = time-hour ":" time-minute ":" time-second [ time-secfrac ]
partial-time = time-hour ":" time-minute [ ":" time-second [ time-secfrac ] ]
full-date = date-fullyear "-" date-month "-" date-mday
full-time = partial-time time-offset

Expand Down
20 changes: 20 additions & 0 deletions toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,14 @@ 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.

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

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 @@ -573,6 +581,12 @@ ldt1 = 1979-05-27T07:32:00
ldt2 = 1979-05-27T00:32:00.999999
```

Seconds may be omitted, in which case `:00` will be assumed.

```toml
ldt3 = 1979-05-27T07:32
```

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 Down Expand Up @@ -602,6 +616,12 @@ lt1 = 07:32:00
lt2 = 00:32:00.999999
```

Seconds may be omitted, in which case `:00` will be assumed.

```toml
lt3 = 07:32
```

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 Down