What to do for Daylight Savings tim

root at uokmet.UUCP root at uokmet.UUCP
Tue Apr 5 04:17:00 AEST 1988


>Unix systems do NOT re-set their clocks when DST starts or ends.  What
>changes is the _print format_ of timestamps that fall into DST.  The
>ctime(3C) function uses the TZ variable to see what your timezone is

That doesn't work for BSD.  There is no such thing as TZ.  Instead,
localtime() in ctime.c needs the following modification:

struct tm *
localtime(tim)
long *tim;
{
...
	daylbegin = 119;	/* last Sun in Apr */
	daylend = 303;		/* Last Sun in Oct */
	if (ct->tm_year==74 || ct->tm_year==75) {
		daylbegin = daytab[ct->tm_year-74].daylb;
		daylend = daytab[ct->tm_year-74].dayle;
	}
	if (ct->tm_year >= 87)			<==== add this
		daylbegin = 96;			<==== add this
...

Anything and everything that uses ctime() needs to be recompiled.

	== kwthomas ==



More information about the Comp.unix.questions mailing list