[Top][All Lists]

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

bug#8782: date command

From: Pádraig Brady
Subject: bug#8782: date command
Date: Thu, 02 Jun 2011 09:48:54 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20100227 Thunderbird/3.0.3

On 02/06/11 00:39, Jesse Gordon wrote:
> On 6/1/2011 4:12 PM, Pádraig Brady wrote:
>> On 01/06/11 18:11, Rick Stanley wrote:
>>> The date command is very useful.  A lot of features and options which I
>>> take advantage of as I need them.  Every once in a while I need to use
>>> the command to convert a UNIX Epoch Date to a normal date, so I attempt
>>> to use the command as:
>>> date -d 1306947372
>>> Which results in the error message, "date: invalid date `1306947372'".
>>> Neither 'date --help' or 'man date' shows that the command should have
>>> been written as:
>>> date -d @1306947372
>>> I needed to do a Google search to see what I was doing wrong. (My memory
>>> is not as good as it used to be!) ;^)
>>> I don't know why this ('@') is needed, since the date command recognizes
>>> many different date formats without specifying the format. For
>>> completeness of the help and man page, please add a line explaining that
>>> when passing a UNIX Epoch Date to the -d option, you need to prefix the
>>> date with a '@'.
>>> Thank you for your time and consideration!
>> You need the '@' to disambiguate. Consider fir example:
>>   date --date=1243
>>   date address@hidden
>> Unfortunately the date input formats are many and varied,
>> and I don't think it's worth getting specific in the man page.
>> The man page currently says:
>> "The date string format is more complex than is easily documented
>> here but is fully described in the info documentation."
>> So I'll close this as adequately documented.
>> thanks,
>> Pádraig.
> Jumpin' whale gills!

Well when you put it like that :)

> I wish I'd known about the -d @ function! I ended
> up writing my own in Perl utility just to convert epochs to dates.
> I'm with Rick on this one. Date supports so many different date formats
> without any special arbitrary characters designating the format. The
> average sys admin just assumes the most simple date format in the world
> would also work the same way.
> Since -d @1234 is so useful, and since it uncharacteristically requires
> an arbitrary prefix code, I think that it would be a very good to put it
> in all forms of documentation, even where the dozens of other obvious
> uses are not documented.

OK how about I put the last 3 or 4 examples from
in an EXAMPLE section in the man page.

There was also a recent report from RMS that
the date input formats wrt TZ were a bit buried.


reply via email to

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