TZ Rationalization Requested

Guy Harris guy at rlgvax.UUCP
Sun Mar 11 17:46:33 AEST 1984


Remember, there is a comment in "ctime.c" that says "This routine does not
work in Saudi Arabia which runs on Solar Time", so the Saudis are screwed by
V6, V7, and USG.

The problem with half-hour time zones could be solved if the "tzset()"
routine were fixed to accept a syntax like

	ZST6:30ZDT

to specify that Zombie Standard Time was 6 hours and 30 minutes off from GMT.
(No offense meant to the people in any such time zone, or to zombies. :-))
And here's the fix (untested, but it looks trivial):

After the line

		timezone = ((long)(n * 60)) * 60;

in "tzset()" in "ctime.c", stick the code:

		if (*p == ':') {
			p++;
			while(*p >= '0' && *p <= '9')
				n = (n * 10) + *p++ - '0';
			if(sign)
				n = -n;
			timezone += n*60;
		}

(This is for the System V "ctime.c", but it's probably the same fix for the
System III "ctime.c".)

Note, BTW, that "timezone" is represented in seconds in USG UNIX; I doubt
that the extra resolution is useful, *but* it saves extra multiplications by
60.  (How to further enhance "tzset" to permit

	WST6:30:05WDT

to specify Wacko Standard Time to be 6 hours, 30 minutes, and 5 seconds off
GMT is left as an exercise for the reader. :-))

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.unix.wizards mailing list