Xref: utzoo comp.mail.uucp:993 news.misc:1197 comp.unix.questions:5449 misc.misc:2273 Path: utzoo!mnetor!uunet!munnari!vuwcomp!dsiramd!pnamd!cstowe!wdr From: wdr@cstowe.csoft.co.nz (Bill) Newsgroups: comp.mail.uucp,news.misc,comp.unix.questions,misc.misc Subject: timezones query Message-ID: <415@cstowe.csoft.co.nz> Date: 3 Feb 88 19:12:29 GMT Organization: Commercial Software Ltd, Palmerston North, New Zealand Lines: 84 Keywords: timezone, GMT Hello Fellow Readers out there in NetLand. I have been having fun with timezones recently and need to get a definitive answer on what my timezone offset should read on my mail headers. Unfortunately I do not have a copy of RFC822 which apparently tells you what it should be. The reason for me posting this query is I have noticed various machines use a different sign for the offset even if they are in the same time zone. eg. mxvax.cwi.nl (They are in the Netherlands) use +0100 (MET) but dutrun (who are also in the Netherlands) use -0100 (MET) Hmmmm. What I want to know is - is the offset added to GMT time to get local time, or is the offset added to local time to get GMT time? I would be inclined to have our offset as +1300 as we are ahead of GMT time, but our installation script says a negative offset indicates we are east of Greenwich (which we are) which would make it -1300. Also the program below only gets the answers right if the offset is negative. Note the instance of USA chauvinism, they are positive and we (ie New Zealand, Aus, those East of London etc) are negative, phooey :->. In fact I get the feeling that because the U.K. got to have Greenwich they decided to keep the USA happy by making them positive :-). ----- Don't Bother Cutting, it don't do much -------- #include #include main() { long now; struct tm localTime,gmtTime; now = time(); localTime = *localtime(&now); spludgeTm("LocalTime",localTime); gmtTime = *gmtime(&now); spludgeTm("GmtTime",gmtTime); tzset(); /* Have to do this to set timezone, which is external, below */ fprintf(stderr,"Time Zone Offset is %ld\n",timezone);/* This be -ve */ exit(0); } spludgeTm(what,timeIs) char *what; struct tm timeIs; { fprintf(stderr,"%s is = %d:%d:%d %d/%d/%d\n",what, timeIs.tm_hour,timeIs.tm_min,timeIs.tm_sec, timeIs.tm_mday,timeIs.tm_mon,timeIs.tm_year); } ---------------------------------------------------------------- BTW we are using a Tower 32/600 running NCR release 1.03.01 which is (as far as I can tell) System V.2. Mail me or post to usenet, whatever works for you. DISCLAIMER - what they don't know can't hurt them. -- Bill D. Ryder ...!uunet!vuwcomp!dsiramd!pnamd!cstowe!wdr Phone 063-65955 (IDD 64) or wdr@csoft.co.nz Commercial Software N.Z. Ltd., PO Box 4030 Palmerston North, Aotearoa (New Zealand if want to use snail mail)