Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!pipex!lyra.csx.cam.ac.uk!
J.S.Peatfield
From: J.S.Peatfi...@amtp.cam.ac.uk (Jon Peatfield)
Newsgroups: comp.sys.sgi.bugs,comp.sys.sgi.admin
Subject: TimeZone and SGI
Followup-To: comp.sys.sgi.admin
Date: 27 Oct 1994 18:16:51 GMT
Organization: Cambridge University DAMTP
Lines: 35
Message-ID: <J.S.PEATFIELD.94Oct27181651@anger.amtp.cam.ac.uk>
NNTP-Posting-Host: anger.amtp.cam.ac.uk

Last weekend we came out of daylight saving in the UK, and all our
machines did this correctly except for the SGIs (runnign Irix-5.2).

They still believed we were in BST, I'd simply set their TZ (in
/etc/TIMEZONE), to GMT0BST.

Much reading of the manual and checking with other people I found that
I need to set the TZ to explitily know the dates/times of transition:

  GMT0:00:00BST1:00:00,86/2:00:00,296/2:00:00

which is correct for 1994, but will need altering every year to get
the correct dates.

Surely there must be a way to make the SGI's TimeZone handling behave
like that in most other Unix systems.  Can someone tell me how to do
this, or what extra package I need to get from SGI?

If there isn't a way to do this automatically what do other people do
to set their TimeZones?  (or does it work in some parts of the world?)

I don't remember having this problem with Irix-4.05, did something get
lost or am I mis-remembering?

Please reply by e-mail and I'll summarise if there is any interest (to
save net-bandwidth.)

  -- Jon Peatfield  (DAMTP, unix network admin)

--
Jon Peatfield, Computer Officer, the DAMTP, University of Cambridge
Telephone: (+44 223) 3-37852     Mail: J.S.Peatfi...@damtp.cam.ac.uk

      Friends don't let friends use PP.     PP: Just say NO.

Path: bga.com!news.sprintlink.net!howland.reston.ans.net!pipex!
lyra.csx.cam.ac.uk!J.S.Peatfield
From: J.S.Peatfi...@amtp.cam.ac.uk (Jon Peatfield)
Newsgroups: comp.sys.sgi.admin
Subject: Re: TimeZone and SGI
Followup-To: comp.sys.sgi.admin
Date: 02 Nov 1994 22:52:25 GMT
Organization: Cambridge University DAMTP
Lines: 72
Message-ID: <J.S.PEATFIELD.94Nov2225225@kro.amtp.cam.ac.uk>
References: <J.S.PEATFIELD.94Oct27181651@anger.amtp.cam.ac.uk>
NNTP-Posting-Host: kro.amtp.cam.ac.uk
In-reply-to: J.S.Peatfield@amtp.cam.ac.uk's message of 27 Oct 1994 18:16:51 GMT

Well several people people replied most seemed to be having similar
problems (SGI are you listening?) and wanted to know what I found out.

A suggestion from SGI itself to use the extended TZ syntax described
in environ(5) will probably work for most TimeZones but it can't
handle the GB-Eire rule to switch out of DST (Sun>=23), so the best
they could offer was something requiring switching TZ values 2 years
out of 4.

Several people sent me scripts, some for various TimeZones which
probably work for them and could be modified to work here, but a
couple of people sent me scripts for the GB-Eire Zone, which saved me
the effort.  Thanks to all those who replied it was great to know that
I wasn't alone in having this problem with the stupid TZ setup.

Here is the best of the scripts slightly modified by me to work beyond
2099 (in case it mattered), and to switch DST at 1.00am GMT as
specified in the public ZoneInfo database.

--cut-here--
#!/bin/sh
# Stolen from Adrian Steinmann, a...@neu.sgi.com
# Last updated : Wed Nov  2 17:13:47 1994
year=`date +"%y"`
leap=0
# Correct leap year guessing beyond the year 2099 as if that matters
# 'cos the rules for switching will have changed before then.  JSP
#
if [ `expr $year \% 4` -eq 0 ] ; then
  leap=1
  if [ `expr $year \% 100` -eq 0 ] ; then
    leap=0
    if [ `expr $year \% 400` -eq 0 ] ; then
      leap=1
    fi
  fi
fi
echo leap: $leap
init=`expr $year - 89 + \( \( $year - 89 \) / 4 \)`
mdys=`expr \( 90 + $leap \) - \( \( \( \( 89 + $leap \) \% 7 \) + $init \) \% 7 \)`
# sdys=`expr $mdys + 210`
# UK summer time ends on 4th Sun after 1st Sat in Oct
if [ `expr \( \( \( 273 + $leap \) \% 7 \) + $init \) \% 7` -eq 0 ]
then sdys=`expr $mdys + 217`
else sdys=`expr $mdys + 210`
fi
# ZoneInfo says the changes take place at 1.00am GMT in both cases  JSP
echo "GMT0BST-1;$mdys/01:00:00,$sdys/02:00:00" > /etc/TZ
cat << !! >/etc/TIMEZONE
# established on `date`
# created automatically by $0
TZ="GMT0BST-1;$mdys/01:00:00,$sdys/02:00:00"
export TZ
!!
exit 0
--cut-here--

Of course for it to take effect you need to reboot between the update
of TIMEZONE and the DST switch.  <switch-catty> Seeing how long
Irix-5.2 managed to stay up this shoudln't be a problem <switch-normal>

Oh why oh why oh why can't Irix just use ZoneInfo like most other
modern unix boxes?

-- Jon Peatfield  (DAMTP unix network admin)

--
Jon Peatfield, Computer Officer, the DAMTP, University of Cambridge
Telephone: (+44 223) 3-37852     Mail: J.S.Peatfi...@damtp.cam.ac.uk

      Friends don't let friends use PP.     PP: Just say NO.

Newsgroups: comp.sys.sgi.admin
Path: bga.com!news.sprintlink.net!pipex!lyra.csx.cam.ac.uk!sunsite.doc.ic.ac.uk!
cc.ic.ac.uk!cmaae47
From: cmaa...@cc.ic.ac.uk (Thomas Sippel - Dau)
Subject: Re: TimeZone and SGI
Message-ID: <1994Nov3.122537.20893@cc.ic.ac.uk>
Originator: cmaae47@sg1
Nntp-Posting-Host: sg1
Reply-To: vult...@imperial.ac.uk
Organization: Imperial College of Science, Technology and Medicine
References: <J.S.PEATFIELD.94Oct27181651@anger.amtp.cam.ac.uk> 
<J.S.PEATFIELD.94Nov2225225@kro.amtp.cam.ac.uk>
Date: Thu, 3 Nov 94 12:25:37 GMT
Lines: 26


In article <J.S.PEATFIELD.94Nov2225...@kro.amtp.cam.ac.uk>, 

- Oh why oh why oh why can't Irix just use ZoneInfo like most other
- modern unix boxes?

Because then it would no longer comply with the various standards
(POSIX, XPG3 etc.) It really is a no-win situation for a manufacturer
if a standard is badly defined (like TZ, which goes to extreme lengths
to specify how to specify dates and times, but fails to say whether
the time in the TZ variable is in the time interpretation before or
after the switch).

So a system can either do The Right Thing (TM), which make it violate
the standard, and fail standard conforming code that is designed to
compensate for the shortcomings of the standard, or it can follow
the standard and accept that sometimes what it does is wrong in reality.
And lets face it, it took SG till IRIX 5 before they got their code
conforming to the standard.

                               Thomas
-- 
*** This is the operative statement, all previous statements are inoperative.
*   email: cmaa...@ic.ac.uk (Thomas Sippel - Dau) (uk.ac.ic on Janet)
*   voice: +44 171 594 6904 (day)        fax: +44 171 594 6958
*   snail: Imperial College of Science, Technology and Medicine

Path: bga.com!news.sprintlink.net!howland.reston.ans.net!pipex!
lyra.csx.cam.ac.uk!J.S.Peatfield
From: J.S.Peatfi...@amtp.cam.ac.uk (Jon Peatfield)
Newsgroups: comp.sys.sgi.admin
Subject: Re: TimeZone and SGI
Date: 04 Nov 1994 17:29:17 GMT
Organization: Cambridge University DAMTP
Lines: 20
Message-ID: <J.S.PEATFIELD.94Nov4172917@kro.amtp.cam.ac.uk>
References: <J.S.PEATFIELD.94Oct27181651@anger.amtp.cam.ac.uk>
	<J.S.PEATFIELD.94Nov2225225@kro.amtp.cam.ac.uk>
	<1994Nov3.122537.20893@cc.ic.ac.uk>
NNTP-Posting-Host: kro.amtp.cam.ac.uk
In-reply-to: cmaae47@cc.ic.ac.uk's message of Thu, 3 Nov 94 12:25:37 GMT

> Because then it would no longer comply with the various standards
> (POSIX, XPG3 etc.) It really is a no-win situation for a manufacturer
> if a standard is badly defined (like TZ, which goes to extreme lengths
> to specify how to specify dates and times, but fails to say whether
> the time in the TZ variable is in the time interpretation before or
> after the switch).

No problem, let the system do what it does with TZ, but if the TZ
variable is unset it can use ZoneInfo.  That way you just don't set
the variable if you want the "correct" behavour...

After all other OSs want to be POSIX/XPG3 etc as well...

  -- Jon
--
Jon Peatfield, Computer Officer, the DAMTP, University of Cambridge
Telephone: (+44 223) 3-37852     Mail: J.S.Peatfi...@damtp.cam.ac.uk

      Friends don't let friends use X25.     X25: Just say NO.

Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!
rutgers!delphi.cs.ucla.edu!twinsun!not-for-mail
From: egg...@twinsun.com (Paul Eggert)
Newsgroups: comp.sys.sgi.admin
Subject: Re: TimeZone and SGI
Date: 5 Nov 1994 15:01:42 -0800
Organization: Twin Sun Inc, El Segundo, CA, USA
Lines: 16
Message-ID: <39h2sm$ep6@tattoo.twinsun.com>
References: <J.S.PEATFIELD.94Oct27181651@anger.amtp.cam.ac.uk> 
<J.S.PEATFIELD.94Nov2225225@kro.amtp.cam.ac.uk> <1994Nov3.122537.20893@cc.ic.ac.uk>
NNTP-Posting-Host: 192.54.239.40

cmaa...@cc.ic.ac.uk (Thomas Sippel - Dau) writes:

>In article <J.S.PEATFIELD.94Nov2225...@kro.amtp.cam.ac.uk>, 
> > Oh why oh why oh why can't Irix just use ZoneInfo like most other
> > modern unix boxes?

> Because then it would no longer comply with the various standards
> (POSIX, XPG3 etc.)

Huh?  The latest zoneinfo implementation conforms to Posix and XPG.
The source code (FTP from elsie.nci.nih.gov in pub/tz*) contains
commentary about how it passes various nitpicky conformance tests.
Several vendors use zoneinfo without failing their conformance tests.

I think the real reason SGI doesn't support zoneinfo
is because Sun supported it first (:-).