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

Clarify sub-millisecond precision is allowed #805

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
30 changes: 15 additions & 15 deletions toml.md
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ To unambiguously represent a specific instant in time, you may use an
```toml
odt1 = 1979-05-27T07:32:00Z
odt2 = 1979-05-27T00:32:00-07:00
odt3 = 1979-05-27T00:32:00.999999-07:00
odt3 = 1979-05-27T00:32:00.5-07:00
odt4 = 1979-05-27T00:32:00.999999-07:00
```

For the sake of readability, you may replace the T delimiter between date and
Expand All @@ -567,10 +568,9 @@ 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
rounded.
Implementations are required to support at least millisecond precision.
Additional digits of precision may be specified, but if they exceed the
supported precision, then the extra digits must be _truncated_, not rounded.

## Local Date-Time

Expand All @@ -582,7 +582,8 @@ implementation-specific.

```toml
ldt1 = 1979-05-27T07:32:00
ldt2 = 1979-05-27T00:32:00.999999
ldt2 = 1979-05-27T07:32:00.5
ldt3 = 1979-05-27T00:32:00.999999
```

Seconds may be omitted, in which case `:00` will be assumed.
Expand All @@ -591,10 +592,9 @@ Seconds may be omitted, in which case `:00` will be assumed.
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
rounded.
Implementations are required to support at least millisecond precision.
Additional digits of precision may be specified, but if they exceed the
supported precision, then the extra digits must be _truncated_, not rounded.

## Local Date

Expand All @@ -615,7 +615,8 @@ or timezone.

```toml
lt1 = 07:32:00
lt2 = 00:32:00.999999
lt2 = 00:32:00.5
lt3 = 00:32:00.999999
```

Seconds may be omitted, in which case `:00` will be assumed.
Expand All @@ -624,10 +625,9 @@ Seconds may be omitted, in which case `:00` will be assumed.
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
rounded.
Implementations are required to support at least millisecond precision.
Additional digits of precision may be specified, but if they exceed the
supported precision, then the extra digits must be _truncated_, not rounded.

## Array

Expand Down