bug-coreutils
[Top][All Lists]
Advanced

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

Re: XML-like date/time support ?


From: Nicolas Mailhot
Subject: Re: XML-like date/time support ?
Date: Sun, 08 Jan 2006 22:06:40 +0100

Le dimanche 08 janvier 2006 à 19:35 +0000, Philip Rowlands a écrit :
> On Sun, 8 Jan 2006, Nicolas Mailhot wrote:
> 
> > The XML folks have defined a single common international date/time
> > format people can actually use :
> > http://www.w3.org/TR/NOTE-datetime
> 
> The W3 consortium has received a proposal, from Reuters, for a subset of 
> ISO 8601, which has been marked "This document is a NOTE made available 
> by the W3 Consortium for discussion only. This indicates no endorsement 
> of its content..."

Yep, no one ever updated the Reuters submission, but that's the datetime
format specified in W3C XML Schema, etc. So don't be fooled by the
unassertive nature or the document - the format itself it a strong
standard and is already used widely

> > Unfortunately it can not be produced by shell scripts using the "date" 
> > command.
> 
> The full format used in the note, save the fractional part of a second, 
> can be specified as:
> 
> $ date '+%Y-%m-%dT%H-%M-%S%:z'
> 2006-01-08T19-29-44+00:00

It's a pity about the fractional part - it's useful when you need to
generate unique identifiers.

> (Note to maintainers - %Z does not appear separately in the 5.93 
> manpage. I don't know enough texinfo or troff to suggest a fix, sorry.)
> 
> > Would it be possible to enhance date and :
> > - add a formatting flag to output the timezone in value (%z ?)
> > - add a formatting shorthand for full date/time in w3c format ?
> 
> I suspect you are using an older version of "date" which lacks the 
> timezone specifiers %z, %:z, %Z etc.

Ok, in fact it's the localized (french) man page that's lagging behind,
you're right %:z works.

Maybe a --iso-8601, --w3c or --xml flag would be in order ?

Regards,

-- 
Nicolas Mailhot

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée


reply via email to

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