home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:3991 comp.unix.questions:9531
- Newsgroups: comp.unix.programmer,comp.unix.questions
- Path: sparky!uunet!boulder!ucsu!tramp.Colorado.EDU!brandy
- From: brandy@tramp.Colorado.EDU (BRANDAUER CARL M)
- Subject: Re: Need (today's date + [1-7] days)
- Message-ID: <1992Jul29.151359.3904@ucsu.Colorado.EDU>
- Keywords: date
- Sender: news@ucsu.Colorado.EDU (USENET News System)
- Nntp-Posting-Host: tramp.colorado.edu
- Organization: University of Colorado, Boulder
- References: <1992Jul16.145836.15586@avalon.nwc.navy.mil> <salem.711339100@pangea.Stanford.EDU> <1992Jul27.234643.16885@cpio1.UUCP>
- Date: Wed, 29 Jul 1992 15:13:59 GMT
- Lines: 24
-
- bernard@cpio1.UUCP (Bernard Fouche) writes:
- [stuff deleted]
-
- >There is also a hack : use TZ and set to a value a negative value if
- >you want to go forward in time, a positive value if you want to go
- >backward. For instance, assuming your TZ is GMT0, to go forward one
- >day, try :
-
- >$ date
- >Mon Jul 27 23:41:44 WET 1992
- >$ TZ=GMT-24 ; export TZ
- >$ date
- >Mon Jul 28 23:41:54 WET 1992
- >$
-
- >To go seven days forward, use GMT-(24*7), i.e. : GMT-168
-
- Since the examples are using either sh or ksh, one can take advantage
- of the little known but powerful keyword feature by writing:
-
- $ TZ=GMT-168 date
-
- which will leave TZ unmodified except during the execution of the date
- command.
-