Re: Idea for date(1) improvement.

From: Ruslan Ermilov <ru_at_FreeBSD.org>
Date: Wed, 8 Sep 2004 15:12:54 +0300
On Wed, Sep 08, 2004 at 11:44:44AM +0000, Bjoern A. Zeeb wrote:
> On Wed, 8 Sep 2004, 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"
> >
> > ?
> 
> -w ? isn't it -v ?  date -v-2d ?
> 
> Anyway I do not like both of this ... I think I haven't used -v
> since that one day in 2000....
> 
> : THE PROBLEM:
> : ---------------
> :
> : for this night :
> :
> : > date
> : Sat Apr  1 00:26:11 CEST 2000
> : > date -v-1d +%Y%m
> : 200002
> : > date -v-1d +%Y%m%d
> : 20000229
> : > date
> : Sat Apr  1 00:26:21 CEST 2000
> 
This one has been long fixed, in date/vary.c,v 1.9 (2000/04/05):

: $ env LC_ALL=C TZ=Europe/Prague ./date -v-1d -j 200004010000
: Tue Feb 29 23:00:00 CET 2000
: $ cvs -R up -r1.9 vary.c
: U vary.c
: $ make date
: cc -O -pipe     -c vary.c
: cc -O -pipe      -o date date.o netdate.o vary.o -lutil
: $ env LC_ALL=C TZ=Europe/Prague ./date -v-1d -j 200004010000
: Fri Mar 31 00:00:00 CEST 2000

Recently, more changes to the -v behavior have been made by yar_at_.


Cheers,
-- 
Ruslan Ermilov
ru_at_FreeBSD.org
FreeBSD committer

Received on Wed Sep 08 2004 - 10:12:57 UTC

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