From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,37d7a16bb2db2c0b X-Google-Attributes: gidfee84,public From: Bob Vickers Subject: Re: Date Calculations Date: 1998/10/29 Message-ID: <3638A5FB.2A015FD7@dcs.rhbnc.ac.uk>#1/1 X-Deja-AN: 406367680 Content-Transfer-Encoding: 7bit References: <6v2mt1$74e$1@nnrp1.dejanews.com> <6vju3c$emk$1@newsflash.concordia.ca> <70g3ro$n8s$1@newsreader1.core.theplanet.net> Content-Type: text/plain; charset=us-ascii Organization: Royal Holloway University of London Mime-Version: 1.0 Reply-To: R.Vickers@dcs.rhbnc.ac.uk Newsgroups: comp.unix.osf.osf1 Mr Mayes wrote: > > >>I want to be able to set a variable to the current date minus 7. I'm using > >>date +"%d-%b-%y"to return the current date and I want to be able to return > >>the same format for 1 week ago. > > > > It should be simple enough using the TZ environment variable. > > TZ=GMT168 date +"+"%d-%b-%y" ought to do the job. > Well it doesn't work on DU 4.0B, and you haven't really any right to expect it to work. You should either get hold of the GNU date program or do it in Perl. Bob -- ====================================================================== Bob Vickers R.Vickers@dcs.rhbnc.ac.uk Dept of Computer Science, Royal Holloway College, University of London WWW: http://www.cs.rhbnc.ac.uk/home/bobv Phone: +44 1784 443691