bug-coreutils
[Top][All Lists]
Advanced

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

Re: date not parsing full iso-8601


From: Paul Eggert
Subject: Re: date not parsing full iso-8601
Date: Fri, 22 Jul 2005 09:30:42 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Jos Backus <address@hidden> writes:

> It would seem that GNU date should simply dispense with emitting the `T'
> between the date and time field in IOS 8601 mode until the parsing of this
> particular format is supported. The `T' is optional according to the standard

It is?  As far as I can tell, it's required.

> Please consider removing the `T' from the iso_format_strings.

That seems a bit extreme, for backward-compatibility reasons.  However,
I agree that the "T" is ugly and should get removed.

How about if we do it by supporting Internet RFC 3339 instead?
See:

G. Klyne & C. Newman
Date and Time on the Internet: Timestamps (2002-07)
<http://www.ietf.org/rfc/rfc3339.txt>

That is, how about if we do the following?

1.  Keep --iso-8601 the way it is, for backward-compatibility reasons,
    but deprecate it and stop documenting it.

2.  Introduce a new option --rfc-3339[=TIMESPEC], with the same operands as
    --iso-8601, but with the following differences:

    2a.  Output a space instead of "T".
         RFC 3339 allows this "for the sake of readability".

    2b.  Output "." instead of "," for the decimal point.
         RFC 3339 requires this.

    2c.  Output ":" between the hours and minutes of the time zone offset.

    2d.  The TIMESPEC defaults to whatever resolution is supported by
         the current host.

3.  For convenience, introduce a new short option -i that is
    equivalent to --rfc-3339 with the default TIMESPEC.  The mnemonic
    is that "-i" is short for "Internet time".

So, for example:

$ date -i
2005-07-22 09:13:17.959906-07:00




reply via email to

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