diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e3c4077..0155d9e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. ## 1.0.0 / 2021-01-11 diff --git a/toml.abnf b/toml.abnf index 3d926ee7..a902c19b 100644 --- a/toml.abnf +++ b/toml.abnf @@ -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 diff --git a/toml.md b/toml.md index 58232cd9..57f8c653 100644 --- a/toml.md +++ b/toml.md @@ -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 @@ -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 @@ -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