Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!rpi!crdgw1!ge-dab!peora!tarpit!bilver!bill From: bill@bilver.UUCP (Bill Vermillion) Newsgroups: comp.unix.questions Subject: Re: Date: Can it be specific to a shell?? Message-ID: <322@bilver.UUCP> Date: 11 Sep 89 03:48:42 GMT References: <72074@yale-celray.yale.UUCP> <1138@virtech.UUCP> Reply-To: bill@bilver.UUCP (Bill Vermillion) Distribution: usa Organization: W. J. Vermillion, Winter Park, FL Lines: 56 In article <1138@virtech.UUCP> cpcahil@virtech.UUCP (Conor P. Cahill) writes: ->In article <72074@yale-celray.yale.UUCP>, zador-anthony@CS.YALE.EDU (anthony zador) writes: ->> ->> How does the UNIX date command know the date? -> ->It performs a time(2) system call which gets the current time in seconds ->(actually this is the count of seconds since Jan 1, 1970 12:00am GMT), the ->ctime(3) library call is then used to generate the date that we all know ->and love. -> ->> Is there some file that is updated? -> ->Nope. -> ->> Must date be the same to all shells on a given machine, -> ->Yup. Believe that answer should be nope. -> ->> or can su selectively adjust the date for a given shell? -> ->Nope. -> H How about Yup. That is the date is displable in several different time zones, but the machine time stays the same - UCT (nee GMT). I just checked. This machines variable for TZ is set as EST5EDT. All I did was spawn a sub-shell and do TZ=CST6CDT; export TZ. Then I did a date, and the machine thought I was in Texas (or somewhere in the Central zone). It realy has to be this way, as you want local time displayed in the time zone of the caller. It makes sense to set TZ variables in the shell if you have callers spanning time zones. If someone calls from CA at 9PM PDT, why should their time display as 1AM EST. Just set their local variable - the time stamp on all the files is correct - it's just the display that changes. It would also be very confusing to have file creation times displayed in the timezone of the machine, rather than the caller. I can see it would be very easy to delete the wrong files - based on time stamps that didn't display local time. Yech! bill -- Bill Vermillion - UUCP: {uiucuxc,hoptoad,petsd}!peora!tarpit!bilver!bill : bill@bilver.UUCP