[comp.sys.att] Daylight Savings Time

ken@inxt.uucp (Kenneth E. Stailey) (04/02/89)

As far as I understand it the UNIX(tm) PC is supposed to switch to daylight
savings time automatically.  I have NEVER seen it work right on time and
would like to know what's happening/how to fix it.

Currently I'm just munging /etc/TZ to simulate the effects of being in EDT.

Please mail replies to either:

	stailey@iris613.gsfc.nasa.gov (preferred) or
	ken@inxt.umd.edu

(or just post to here)

jlw@lznv.ATT.COM (J.L.WOOD) (04/03/89)

In article <143@dftsrv.gsfc.nasa.gov>, ken@inxt.uucp (Kenneth E. Stailey) writes:
> As far as I understand it the UNIX(tm) PC is supposed to switch to daylight
> savings time automatically.  I have NEVER seen it work right on time and
> would like to know what's happening/how to fix it.
> 
> Currently I'm just munging /etc/TZ to simulate the effects of being in EDT.
> 

It used to work for me in the past and there is one reason
why it might not have worked for you in the past and another
reason why it isn't going to work again unless you implement
the patch that was posted last week.

(1) In order to have the time zone change take place when the
    UNIX-PC's algorithm says to change, you must have the machine
    powered on and booted up at the time the change takes place -
    ie at 2:00 am on the third Sunday morning  in April.  I leave
    both my home and office UNIX-PCs running al the time.

(2) The Gov't in its infinite wisdom has changed the commencement
    of DST to the first Sunday Morning in April.  I doubt that there
    would be an official upgrade to fix this problem.  I've taken to
    just changing the time and then changing it back again two weeks
    later.


Joe Wood
jlw@lznv.ATT.COM

woods@tmsoft.uucp (Greg Woods) (04/05/89)

In article <1567@lznv.ATT.COM> jlw@lznv.ATT.COM (J.L.WOOD) writes:
>In article <143@dftsrv.gsfc.nasa.gov>, ken@inxt.uucp (Kenneth E. Stailey) writes:
>> As far as I understand it the UNIX(tm) PC is supposed to switch to daylight
>> savings time automatically.  I have NEVER seen it work right on time and
>> would like to know what's happening/how to fix it.
>> 
>> Currently I'm just munging /etc/TZ to simulate the effects of being in EDT.
>>
>[....]
>
>(1) In order to have the time zone change take place when the
>    UNIX-PC's algorithm says to change, you must have the machine
>    powered on and booted up at the time the change takes place -
>    ie at 2:00 am on the third Sunday morning  in April.  I leave
>    both my home and office UNIX-PCs running al the time.

All unix machines should ALWAYS be running, except during hardware
maintenance.  :-)

>(2) The Gov't in its infinite wisdom has changed the commencement
>    of DST to the first Sunday Morning in April.  I doubt that there
>    would be an official upgrade to fix this problem.  I've taken to
>    just changing the time and then changing it back again two weeks
>    later.

Likewise the Canadian Gov't, which didn't want to stray too far from
our Big Brother!

As a friend of mine is fond of saying: "That's nothing, what about all
those thousands of Japanese watches that automatically change two
weeks too late!"

As Ken originally suggested above, munging TZ is the best way to go if
you don't have source (or at least objects) for those utilities that
use the date functions.  Just set TZ=EDT4EST (in my case) for the two
weeks (in your (/etc/rc && /etc/profile) || /etc/TZ || /etc/TIMEZONE,
as the case may be) till the system catches up with our timely
politicians.  Changing the system time isn't as elegant.

Just for the record, I HATE daylight savings time, but then again, I'm
a farmer from Saskatchewan (right in the middle of a "natural"
timezone), so what do I know.  I must admit it does help a bit in Toronto.
-- 
						Greg A. Woods.

woods@{{tmsoft,utgpu,gate,ontmoh}.UUCP,utorgpu.BITNET,gpu.utcs.Toronto.EDU}
1-416-443-1734 [h]	1-416-595-5425 [w]		Toronto, Ontario, Canada

ditto@cbmvax.UUCP (Michael "Ford" Ditto) (04/06/89)

In article <1989Apr4.175630.18101@tmsoft.uucp> woods@tmsoft.UUCP (Greg Woods) writes:
>Just set TZ=EDT4EST (in my case) for the two
>weeks (in your (/etc/rc && /etc/profile) || /etc/TZ || /etc/TIMEZONE,

That should be "EDT4", not "EDT4EST", lest strange things happen at the
end of April (it wouldn't be EST or EDT, but Something Completely
Different).  If you use EDT4, you can change it back at your leisure,
anytime between the start and end of DST.
-- 
					-=] Ford [=-

"This is yet another example of how	In Real Life:  Mike Ditto)
our actions have random results."	ford@kenobi.cts.com
	- Cmdr. Data ("Contagion")	...!sdcsvax!crash!elgar!ford
					ditto@cbmvax.commodore.com

sewilco@datapg.MN.ORG (Scot E Wilcoxon) (04/06/89)

Things may get worse.  Congress is again considering a "uniform poll
closing" bill.  A side effect of the bill would be to keep PDT in
effect until after the election, while the rest of the contiguous
USA would end Daylight Savings Time earlier.

I suggest using the "timezone" package, or other time packages with
source, in your favorite time-sensitive applications.  Sooner or
later you'll have to change the coded/tabled rules.
-- 
Scot E. Wilcoxon  sewilco@DataPg.MN.ORG    {amdahl|hpda}!bungia!datapg!sewilco
Data Progress 	 UNIX masts & rigging  +1 612-825-2607    uunet!datapg!sewilco
	I'm just reversing entropy while waiting for the Big Crunch.

scl@virginia.acc.virginia.edu (Steve Losen) (04/14/89)

Here is a little script that we run every night with cron
just to make sure the timezone file /etc/TIMEZONE is correct.
It puts the kluge in the TIMEZONE file if the current day lies between
the first and last Sunday in April.  We run it every night because
we have a lot of machines and we don't trust them all to be up
on the two critical Sundays.


set `date`

file=/etc/TIMEZONE
line="TZ=EST5EDT; export TZ"
day=$1
month=$2
num=$3

if [ "$month" = "Apr" ] ;then

    case $day in
      Sun)  lower=0; upper=24;;
      Mon)  lower=1; upper=25;;
      Tue)  lower=2; upper=26;;
      Wed)  lower=3; upper=27;;
      Thu)  lower=4; upper=28;;
      Fri)  lower=5; upper=29;;
      Sat)  lower=6; upper=30;;
    esac

    if [ $num -gt $lower -a $num -lt $upper ] ;then
       line="TZ=EDT4; export TZ"
    fi
fi

echo "$line" > $file
-- 
Steve Losen     scl@virginia.edu
University of Virginia Academic Computing Center