Idea for date(1) improvement.

Geoff Speicher geoff at speicher.org
Wed Sep 8 05:30:33 PDT 2004


On Wed, Sep 08, 2004 at 12:51:00PM +0200, Poul-Henning Kamp wrote:
> 
> I have sometimes needed to get the date of yesterday or last monday
> and so on for creating filenames.
> 
> We have this very flexible code in at(1) and cvs(1) for specifying
> time.
> Anyone up for making it possible to say:
>
>   date -w "2 days ago"

FWIW, there's a public-domain implementation that PHP uses for its
strtotime() function (http://php.net/strtotime), and it appears to do
all/most of what /usr/src/usr.bin/at/parsetime.c does, plus more (time
zones, for example).

	http://cvs.php.net/co.php/php-src/ext/standard/parsedate.y?r=1.56

Geoff



More information about the freebsd-current mailing list