home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / unix / question / 13582 < prev    next >
Encoding:
Text File  |  1992-11-18  |  1.4 KB  |  39 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!iggy.GW.Vitalink.COM!cs.widener.edu!dsinc!gvls1!jabber!candle!root
  3. From: root@candle.uucp (Bruce Momjian)
  4. Subject: Re: Tomorrow's date? (Utility?)
  5. Organization: a consultant's basement
  6. Distribution: comp.unix.shell
  7. Date: Wed, 18 Nov 1992 01:26:01 GMT
  8. Message-ID: <1992Nov18.012601.17779@candle.uucp>
  9. X-Newsreader: TIN [version 1.1 PL6]
  10. References: <1992Nov16.231545.10656@cheshire.oxy.edu>
  11. Lines: 26
  12.  
  13. Linda A. Malcor (legend@cheshire.oxy.edu) wrote:
  14. : I'm looking for a (standard) unix utility that can tell me what tommorow's
  15. : date is (as well as the date 15hrs in the future/past, etc.). Any ideas?
  16. : Date math is so common, I'd just like to avoid reinventing the wheel.
  17.  
  18. You can set the TZ environment variable ( defined in /etc/TIMEZONE ) on
  19. the command line before calling 'date'.  For example, I am in the
  20. Eastern Time zone, so my TIMEZONE file says:
  21.  
  22.     # established Sun Apr  5 09:55:46 EDT 1992
  23.     TZ=EST5EDT
  24.     export TZ
  25.  
  26. I am +5 hours from GMT, to to get tommorow's date, I use (-24 + 5) or -19,
  27. like this:
  28.  
  29.     TZ=EST-19EDT date
  30.  
  31. and I get the time and date exactly 24 hours in the future.  The export TZ
  32. is not needed.
  33. -- 
  34. Bruce Momjian                          |  830 Blythe Avenue
  35. root%candle.uucp@bts.com               |  Drexel Hill, Pennsylvania 19026 
  36.   +  If your life is a hard drive,     |  (215) 353-9879(w) 
  37.   +  Christ can be your backup.        |  (215) 853-3000(h)
  38.