parse-datetime: accept ISO 8601 date and time rep with "T" separator
authorJ.T. Conklin <jtc@acorntoolworks.com>
Wed, 17 Aug 2011 23:40:49 +0000 (16:40 -0700)
committerJim Meyering <meyering@redhat.com>
Wed, 31 Aug 2011 14:23:29 +0000 (16:23 +0200)
commitc2ecbc9a8262595b27f741e41375d06213a30fb6
tree726d561993d28cae965b681c144279e23cffc46a
parenta5a35f0cfc24fc0b206be30aba2bf7b98d522082
parse-datetime: accept ISO 8601 date and time rep with "T" separator

The parser 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"

* lib/parse-datetime.y: Parse ISO 8601 extended date and time
of day representation using the 'T' separator character.
* doc/parse-datetime.texi (General date syntax): replace use of
deprecated --iso-8601 option with --rfc-3339 in example of date
command output formats that can be parsed.
* tests/test-parse-datetime.c (tm_diff): New function, taken from
lib/parse-datetime.y.
(gmt_offset): New function.
(main): Add additional test cases to validate ISO8601 extended
date and time of day format parsing.
ChangeLog
doc/parse-datetime.texi
lib/parse-datetime.y
tests/test-parse-datetime.c