Re: Idea for date(1) improvement.

From: Geoff Speicher <geoff_at_speicher.org>
Date: Wed, 8 Sep 2004 08:30:29 -0400
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
Received on Wed Sep 08 2004 - 10:30:33 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:11 UTC