*BSD News Article 11739


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA2092 ; Thu, 25 Feb 93 10:11:27 EST
Newsgroups: comp.os.386bsd.misc
Path: sserve!manuel.anu.edu.au!munnari.oz.au!metro!ipso!runxtsa!bde
From: bde@runx.oz.au (Bruce Evans)
Subject: Re: bsd has wrong date (-1 day)
Message-ID: <1993Feb24.000804.19805@runx.oz.au>
Organization: RUNX Un*x Timeshare.  Sydney, Australia.
References: <hg926cy.730393047@unidui> <PC123.93Feb22211035@bootes.cus.cam.ac.uk>
Date: Wed, 24 Feb 93 00:08:04 GMT
Lines: 47

In article <PC123.93Feb22211035@bootes.cus.cam.ac.uk> pc123@cus.cam.ac.uk (Pete Chown) writes:
>In article <hg926cy.730393047@unidui> hg926cy@unidui.uni-duisburg.de (Cyrus) writes:

>   After every boot I have to fix the date to the current.
>   It's always one day back.

>Change which side of the international date line you are on!  In your
>timezone file, you swap it by changing, for example GMT minus fourteen
>hours to GMT plus ten hours.

The 0.1 kernel has a leap year bug for years 1993, 1994, 1996, 1997, ...
The bug is fixed in the patchkit, and there are various ways to fix it
by fudging an extra timezone offset.  I'm not sure what Pete means by
"timezone file".  For the kernel, the timezone adjustment should be made
to the kernel config file (+- 24 hours).

>Incidentally the timezone module assumes you have (I think) Pacific
>time set in your CMOS, and want this corrected before being used.  In

It assumes GMT.  Adjustments are made in 2 places:

1. Kernel config file.  The timezone and DST adjustments help convert from
   the clock time to GMT (times inside the kernel are all in GMT).  The
   clock is often run on local time to suit DOS, but it can be run on GMT,
   in which case you have to change the adjustments to 0.  You have to
   change the adjustments to suit local time too - I think the defaults
   are for Pacific time.
   
   The DST adjustment does not work.  It is "fixed" in the patchkit, but
   still uses hard-coded changeover dates that are completely wrong in
   the southern hemisphere.  I add the DST adjustment to the timezone
   adjustment.  This requires a kernel recompile or edit twice a year.

2. Local time file (/etc/localtime).  This contains data to convert from
   kernel time (GMT) to local time.  Usually it is a symlink to a timezone
   file for your locality.  You have to change the symlink when installing
   the system.

Getting the kernel timezone adjustment right is too hard.  There are good
reasons why the timezone database is so large.  For adjusting from local
time to GMT, I suggest the following method:

a. For booting the kernel, assume the clock is on GMT.
b. In /etc/rc, run a utility to correct the kernel time by the difference
   between local time and GMT.
-- 
Bruce Evans  (bde@runx.oz.au)