Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Sep 2004 08:30:29 -0400
From:      Geoff Speicher <geoff@speicher.org>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        current@freebsd.org
Subject:   Re: Idea for date(1) improvement.
Message-ID:  <20040908123029.GA74545@sirius.speicher.org>
In-Reply-To: <38933.1094640660@critter.freebsd.dk>
References:  <38933.1094640660@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040908123029.GA74545>