From owner-freebsd-current@FreeBSD.ORG Wed Sep 8 12:12:57 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D8DE016A4CE for ; Wed, 8 Sep 2004 12:12:57 +0000 (GMT) Received: from tigra.ip.net.ua (tigra.ip.net.ua [82.193.96.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2D8943D48 for ; Wed, 8 Sep 2004 12:12:56 +0000 (GMT) (envelope-from ru@ip.net.ua) Received: from heffalump.ip.net.ua (heffalump.ip.net.ua [82.193.96.213]) by tigra.ip.net.ua (8.12.11/8.12.11) with ESMTP id i88CCqoI014678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 8 Sep 2004 15:12:53 +0300 (EEST) (envelope-from ru@ip.net.ua) Received: (from ru@localhost) by heffalump.ip.net.ua (8.13.1/8.13.1) id i88CCsbo092252; Wed, 8 Sep 2004 15:12:54 +0300 (EEST) (envelope-from ru) Date: Wed, 8 Sep 2004 15:12:54 +0300 From: Ruslan Ermilov To: "Bjoern A. Zeeb" Message-ID: <20040908121254.GC86996@ip.net.ua> References: <38933.1094640660@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s/l3CgOIzMHHjg/5" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new cc: Poul-Henning Kamp cc: current@FreeBSD.org Subject: Re: Idea for date(1) improvement. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Sep 2004 12:12:58 -0000 --s/l3CgOIzMHHjg/5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Sep 08, 2004 at 11:44:44AM +0000, Bjoern A. Zeeb wrote: > On Wed, 8 Sep 2004, Poul-Henning Kamp wrote: >=20 > > 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" > > > > ? >=20 > -w ? isn't it -v ? date -v-2d ? >=20 > Anyway I do not like both of this ... I think I haven't used -v > since that one day in 2000.... >=20 > : 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 >=20 This one has been long fixed, in date/vary.c,v 1.9 (2000/04/05): : $ env LC_ALL=3DC TZ=3DEurope/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=3DC TZ=3DEurope/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@. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --s/l3CgOIzMHHjg/5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD8DBQFBPvdGqRfpzJluFF4RAgXfAKCOLoVVNYep7tbCPXMb16cjT5KxjACeLgpE +XwH4TnI3+VlEHCedsrnKt8= =GUDg -----END PGP SIGNATURE----- --s/l3CgOIzMHHjg/5--