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: Jim Meyering
Subject: Re: XML-like date/time support ?
Date: Sun, 08 Jan 2006 22:15:24 +0100

Nicolas Mailhot <address@hidden> wrote:
>> 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.

Doesn't %N do what you want?

  %N   nanoseconds (000000000..999999999)

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

>From --help output:

      --rfc-3339=TIMESPEC   output date and time in RFC 3339 format.
                            TIMESPEC=`date', `seconds', or `ns' for
                            date and time to the indicated precision.

E.g.,

  $ date --rfc-3339=ns
  2006-01-08 22:14:12.196485000+01:00




reply via email to

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