bug-coreutils
[Top][All Lists]
Advanced

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

Re: Undocumented feature of 'date -d'


From: Eric Blake
Subject: Re: Undocumented feature of 'date -d'
Date: Sat, 30 May 2009 14:57:44 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruce Jerrick on 5/27/2009 8:00 PM:
> The man page for date(1) does not document that a date string for the
> -d (--date) option can be given as seconds-from-the-epoch, if preceded
> by '@'.  E.g.: 'date -d @1243474654'.  (Do you have any idea how many
> years I've been wanting that functionality, but thought that date didn't
> do it???)

That format is already documented in the info pages.  It is also
documented in the FAQ:
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#The-date-command-is-not-working-right_002e

There are too many valid date formats to document them all in the man
page, so we've gone with a minimalistic approach and a reference to the
info page instead.

> 
> A fix (to man/date.1 of coreutils-7.2.tar.gz) is included below.

Unfortunately, man/date.1 is a generated file.  You need to patch the
upstream file instead, src/date.c, in the usage() function.  I'll leave it
to others whether your patch is worthwhile or adds too much bulk to the
already verbose 'date --help' output.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkohncgACgkQ84KuGfSFAYBV5wCghpHcm4P8tMCDzSWvsk1J9M6i
LhIAmwcpJLWOrDNVbs0EabMReKbSerrW
=+u4u
-----END PGP SIGNATURE-----




reply via email to

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