Subject: bug#35032: date ISO 8601 / RFC 3339 formats

From: Erik Auerswald <[email-masked]>
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