home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / programm / 3991 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  1.3 KB

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