[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: date not parsing full iso-8601
From: |
Jos Backus |
Subject: |
Re: date not parsing full iso-8601 |
Date: |
Fri, 22 Jul 2005 09:42:02 -0700 |
User-agent: |
Mutt/1.5.9i |
Hi Paul,
On Fri, Jul 22, 2005 at 09:30:42AM -0700, Paul Eggert wrote:
> 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.
Note that I haven't read the actual standards document. But if that is the
case, then how can the following be valid formats according to Markus Kuhn's
document (which w3.org links to, btw)?
<quote>
This means that the following two notations refer to exactly the same point in
time:
1995-02-04 24:00 = 1995-02-05 00:00
</quote>
> > 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>
Thanks for the link, I'll have a look.
> 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
Good plan, I like this. Thanks Paul.
--
Jos Backus
jos at catnook.com