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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35032 in the body.
You can then email your comments to 35032 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-coreutils <at> gnu.org:
bug#35032; Package coreutils. (Thu, 28 Mar 2019 17:21:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Mailhot <nicolas.mailhot <at> laposte.net>:
New bug report received and forwarded. Copy sent to bug-coreutils <at> gnu.org. (Thu, 28 Mar 2019 17:21:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Mailhot <nicolas.mailhot <at> laposte.net>
To: bug-coreutils <at> gnu.org
Subject: date ISO 8601 / RFC 3339 formats
Date: Thu, 28 Mar 2019 18:20:14 +0100
Hi

A long, long time ago, in 1997, W3C looked at the monument ISO 8601 was, 
and produced a simplified profile for mere mortals:
https://www.w3.org/TR/NOTE-datetime

It serves as formatting basis in XML, IJSON, etc

Sometime later, in 2002, the IETF took this note, fleshed it out a 
little, and produced RFC 3339

And then coreutils date took it all and grew the --iso-8601 and 
--rfc-3339

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

and then removed T from its --rfc-3339 option
$ date --rfc-3339=seconds
2019-03-28 18:10:11+01:00

Graaa

Would it be possible to make them both optional in --rfc-3339, and both 
mandatory in --iso-8601 ? Or add a --w3c option that conforms to the W3C 
profile? This is all so sad… Some languages like Go do no understand 
neither of date's output, because they follow the W3C profile.

Regards,

-- 
Nicolas Mailhot




Information forwarded to bug-coreutils <at> gnu.org:
bug#35032; Package coreutils. (Thu, 28 Mar 2019 17:44:02 GMT) Full text and rfc822 format available.

Message #8 received at 35032 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Nicolas Mailhot <nicolas.mailhot <at> laposte.net>, 35032 <at> debbugs.gnu.org
Subject: Re: bug#35032: date ISO 8601 / RFC 3339 formats
Date: Thu, 28 Mar 2019 10:43:42 -0700
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?





Information forwarded to bug-coreutils <at> gnu.org:
bug#35032; Package coreutils. (Thu, 28 Mar 2019 17:49:02 GMT) Full text and rfc822 format available.

Message #11 received at 35032 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Nicolas Mailhot <nicolas.mailhot <at> laposte.net>, 35032 <at> debbugs.gnu.org
Subject: Re: bug#35032: date ISO 8601 / RFC 3339 formats
Date: Thu, 28 Mar 2019 11:48:17 -0600
severity 35032 wishlist
retitle 35032 date: adjust rfc8601/3339 formats to W3C standard
stop

On 2019-03-28 11:20 a.m., Nicolas Mailhot wrote:
> Would it be possible to make them both optional in --rfc-3339, and both 
> mandatory in --iso-8601 ? Or add a --w3c option that conforms to the W3C 
> profile? This is all so sad… Some languages like Go do no understand 
> neither of date's output, because they follow the W3C profile.

I'm marking this as a "wishlist" item.
For reference, here are previously similar requests:

https://bugs.gnu.org/6132 - date: --rfc-3339=TIMESPEC option doesn't 
print 'T'

https://bugs.gnu.org/6453 - date -- Add new options for ISO 8601 date 
formats (-O)

https://bugs.gnu.org/14097 - date: add parsing support for ISO 8601 
basic format

-assaf





Severity set to 'wishlist' from 'normal' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 28 Mar 2019 17:49:02 GMT) Full text and rfc822 format available.

Changed bug title to 'date: adjust rfc8601/3339 formats to W3C standard' from 'date ISO 8601 / RFC 3339 formats' Request was from Assaf Gordon <assafgordon <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 28 Mar 2019 17:49:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-coreutils <at> gnu.org:
bug#35032; Package coreutils. (Thu, 28 Mar 2019 21:08:02 GMT) Full text and rfc822 format available.

Message #18 received at 35032 <at> debbugs.gnu.org (full text, mbox):

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: Re: 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




Information forwarded to bug-coreutils <at> gnu.org:
bug#35032; Package coreutils. (Fri, 29 Mar 2019 09:00:02 GMT) Full text and rfc822 format available.

Message #21 received at 35032 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Mailhot <nicolas.mailhot <at> laposte.net>
To: Erik Auerswald <auerswal <at> unix-ag.uni-kl.de>, Paul Eggert
 <eggert <at> cs.ucla.edu>
Cc: 35032 <at> debbugs.gnu.org
Subject: Re: bug#35032: date ISO 8601 / RFC 3339 formats
Date: Fri, 29 Mar 2019 09:59:33 +0100
Le jeudi 28 mars 2019 à 22:07 +0100, Erik Auerswald a écrit :
> 
> > 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.


And, testing some more, on, a system with a more recent version of
coreutils, that I had no access to yesterday:

date --iso-8601=seconds had its output changed 
2019-03-29T09:54:41+01:00

Which is W3C compliant. So it seems someone already reported the
problem in the past, and it has already been fixed.

A lot of thanks to the person who did the fix and the person who
reported the problem before me, whoever they are.

And thanks to Eric for clarifying my report

The bug can be closed.

Regards,

-- 
Nicolas Mailhot





bug closed, send any further explanations to 35032 <at> debbugs.gnu.org and Nicolas Mailhot <nicolas.mailhot <at> laposte.net> Request was from Paul Eggert <eggert <at> cs.ucla.edu> to control <at> debbugs.gnu.org. (Thu, 20 Feb 2020 16:23:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 20 Mar 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 36 days ago.

Previous Next


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