Subject: Re: bug#10455: Date: Possible bug in ISO-8601 formatted dates

From: Bob Proulx <[email-masked]>
Date: Sun, 8 Jan 2012 23:49:27 -0700

Dotan Cohen wrote:
> It seems that ISO-8601 formated dates are not properly handled by the
> date utility.

GNU date didn't learn how to handle ISO-8601 until very recently.
Your version 8.5 doesn't have that code yet.  Here is the NEWS file
entry for the change as it went into the recent 8.13 release.

* Noteworthy changes in release 8.13 (2011-09-08) [stable]

** New features

  date now accepts ISO 8601 date-time strings with "T" as the
  separator.  It has long parsed dates like "2004-02-29 16:21:42"
  with a space between the date and time strings.  Now it also parses
  "2004-02-29T16:21:42" and fractional-second and time-zone-annotated
  variants like "2004-02-29T16:21:42.333-07:00"

And here is the ChangeLog entry:

        date: support parsing of ISO-8601-with-"T" dates
        Thanks to an improvement in gnulib's parse-datetime module,
        commands like this now succeed (output manually indented):
            $ ./date -u -d 2004-02-29T16:21:42.33+07:00 +%FT%T.%N%z
                           2004-02-29T09:21:42.330000000+0000
        * tests/misc/date: Add a test to exercise the new-in-gnulib
        parsing of ISO8601-with-"T" dates.
        * NEWS (New features): Mention it.
        * gnulib: Update, to pull in this parse-datetime improvement.

Bob