GNU bug report logs - #35032
date: adjust rfc8601/3339 formats to W3C standard

Previous Next

Package: coreutils;

Reported by: Nicolas Mailhot <nicolas.mailhot <at> laposte.net>

Date: Thu, 28 Mar 2019 17:21:02 UTC

Severity: wishlist

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 35032 <at> debbugs.gnu.org, Nicolas Mailhot <nicolas.mailhot <at> laposte.net>
Subject: bug#35032: date ISO 8601 / RFC 3339 formats
Date: Thu, 28 Mar 2019 22:07:43 +0100
Hi,

On Thu, Mar 28, 2019 at 10:43:42AM -0700, Paul Eggert wrote:
> On 3/28/19 10:20 AM, Nicolas Mailhot wrote:
> > Would it be possible to make them both optional in --rfc-3339, and
> > both mandatory in --iso-8601 ?
> 
> Sorry, I don't understand what you're proposing, specifically. Can you
> say exactly what you want, with specific calls to 'date' and what you
> want the output to look like, and why?

Sadly, you stripped too much of the original mail. I'll repeat the
relevant parts of that mail:

On Thu, Mar 28, 2019 at 06:20:14PM +0100, Nicolas Mailhot wrote:
> A long, long time ago, [...]
> Unfortunately, coreutils managed to make both of those incompatible
> with the W3C iso-8601 profile lots of software languages use:
> 
> 1. The W3C profile mandates T as time separator, and ":" as
> hour/minutes separator
> 2. RFC 3339 makes both optional
> 
> Then, logically, date removed the ":" for its --iso-8601 option,
> $ date --iso-8601=seconds
> 2019-03-28T18:09:47+0100
                       ^^
                       there should be a ':' for W3C compatibility

> and then removed T from its --rfc-3339 option
> $ date --rfc-3339=seconds
> 2019-03-28 18:10:11+01:00
            ^
            there should be a 'T' for W3C compatibility

> [...]

Nicolas asks for an ISO 8601 compatible format using both a 'T' as
separator between date and time, and a ':' as separator between hours
and minutes in the timezone designator, as well as the other contents
that are identical in --iso-8601 and --rfc-3339.

From looking at https://www.w3.org/TR/NOTE-datetime, the important part
is using both 'T' and a TZD with ':' in the middle, the other variability
(e.g. minutes, seconds, fractional seconds as decimals) can be chosen
as fits.

Thanks,
Erik
-- 
I do like the 24 hour a day development process. I can describe a
problem, go to sleep, and have the answer in my mailbox with my first
cup of coffee.
                        -- Dave Täht




This bug report was last modified 5 years and 87 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.