bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25448: RFC 3339 misdescribed in doc of date(1)


From: Zefram
Subject: bug#25448: RFC 3339 misdescribed in doc of date(1)
Date: Sat, 14 Jan 2017 16:21:17 +0000

The manual for version 8.26 of coreutils, in the section on date(1)'s
--rfc-3339 option, says of RFC 3339:

        This is a subset of the ISO 8601 format, except that it also
        permits applications to use a space rather than a `T' to separate
        dates from times.

This description is not quite correct, in two respects.

Firstly, the formal syntax of RFC 3339 requires the "T" (of either case),
and does not permit a space.  The bit about permitting a space is not
part of the official syntax; it is a suggestion that applications could
choose to use that non-standard top-level syntax while still using the
standard syntax for the date and time portions within it.  Applications
inherently have that kind of usage choice, when presented with such a
collection of syntax pieces, so this isn't really a difference between
ISO 8601 and RFC 3339.  Indeed, it was a common choice among users of
ISO 8601 before RFC 3339 came along.  This also means that the formats
actually offered by --rfc-3339 don't strictly conform to RFC 3339.

Secondly, RFC 3339 does have an actual deviation from ISO 8601.  When a
timezone with zero offset from UT is specified numerically, ISO 8601
requires it to be stated with a "+" sign, as "+00:00" (or "+00" or
"+0000").  RFC 3339 explicitly permits this to be specified with a "-"
sign, as "-00:00", which is forbidden by ISO 8601.  (RFC 3339 adopts this
notation and its `unknown zone' connotation from RFC 2822, which doesn't
claim conformance to ISO 8601.)  date(1) doesn't actually use this part
of RFC 3339, but the fact that it exists means that conformance to RFC
3339 doesn't imply conformance to ISO 8601.  That's an issue for the
documentation's attempt to describe what conforms to what.

I suggest that the first two sentences of the --rfc-3339 doc should
change from

        Display the date using a format specified by Internet RFC 3339.
        This is a subset of the ISO 8601 format, except that it also
        permits applications to use a space rather than a `T' to separate
        dates from times.

to

        Display the date using a format based on Internet RFC 3339,
        which is nearly a subset of ISO 8601.

and furthermore the descriptions of the specific formats should be
annotated to discuss their conformance.  "date" should say

        This format conforms to both RFC 3339 and ISO 8601.

"seconds" and "ns" should say

        The two main portions of the format each conform to both RFC 3339
        and ISO 8601, but the standards require them to be combined with a
        "T" separator, so this space separator does not conform.

-zefram





reply via email to

[Prev in Thread] Current Thread [Next in Thread]