[comp.unix.questions] What to do for Daylight Savings tim

root@uokmet.UUCP (04/05/88)

>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 ==

richl@penguin.USS.TEK.COM (Rick Lindsley) (04/07/88)

In article <600016@uokmet.UUCP> root@uokmet.UUCP writes:
    
    That doesn't work for BSD.  There is no such thing as TZ.  Instead,
    localtime() in ctime.c needs the following modification:
    
Geez, no, don't do that! Install the fixes that Berkeley themselves
distributed, which puts the table outside the library so it can be
changed when legislators change their minds again! Unless you LIKE
recompiling everything on the system.

Rick

root@uokmet.UUCP (04/12/88)

>In article <600016@uokmet.UUCP> root@uokmet.UUCP writes:
>    
>    That doesn't work for BSD.  There is no such thing as TZ.  Instead,
>    localtime() in ctime.c needs the following modification:
>    
>Geez, no, don't do that! Install the fixes that Berkeley themselves
>distributed, which puts the table outside the library so it can be
>changed when legislators change their minds again! Unless you LIKE
>recompiling everything on the system.
>
>Rick

I've never seen anything distributed by Berkeley.  Also, there are no tables
whatsoever to change in 2.9BSD.

	== kwthomas ==