[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: timezones



"Bruno Hertz" <brrhtz@yahoo.de> writes:

> michael <linux@networkingnewsletter.org.uk> writes:
>
>> Here in the UK we recently went to British Summer Time, putting the
>> clocks +1hr from GMT. On my dual boot (Debian + WinXP) it now seems I
>> have a problem. WinXP reports the correct BST time, whereas Debian is an
>> additional hour in front (ie GMT+2 instead of GMT+1) but I can't work
>> out why. A quick Internet search didn't throw anything up.
>>
>> I'm running:
>> michael@manchester-campaigns:~$ uname -a;cat /etc/apt/sources.list
>> Linux manchester-campaigns 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002
>> i686 GNU/Linux
>>
>> deb ftp://ftp.uk.debian.org/debian/ unstable main non-free contrib
>>
>> with Real Time Clock Driver v1.10e
>>
>> Not sure what other info to add (I thought there were msgs about
>> hardware clock at boot but not sure how to access these - not in dmesg)
>>
>> Ta for any advice!
>
> Afaik, there's nothing to correct this on the Windows side. You can
> however choose localtime as your default Linux hardware clock time
> also with hwclock (cf. man hwclock). In this case, the glibc timezone
> library will _not_ add another hour for BST, and Windows and Linux time
> should be in sync again. This might have the drawback however that Linux
> itself won't change any more from GMT to BST or vice versa. At least that's
> the last I heard of, it might have changed in the meantime. So when that
> changes occur (last Sunday in March and October), you have to set the
> hardware clock either yourself on Linux or, hehe, by booting into Windows :)

Final remark for the records, because regarding Debian policies my above
remarks are wrong.

As said in another post, the safest method to reset the time zone is
running base-config again.

Now, if that wasn't possible, Debian still recommends, as I now found out,
to not mess with hwclock directly. Cf.
/usr/share/doc/util-linux/README.Debian.hwclock.gz

So, if I'd have to do it without base-config, I'd proceed as follows
(hoping that it does work correctly, and I'd say there's a pretty good
chance)

* set system time to the correct time with date, because it's one
  hour ahead
* set UTC=no in /etc/default/rcS
* remove /etc/adjtime, just to be sure
* then reboot.

On shutdown, /etc/init.d/hwclock.sh will be executed and store the
now correct system time to the hardware clock, this time as localtime
because of the rcS setting. Also /etc/adjtime will be regenerated, this
time with LOCAL instead of UTC. And upon boot, all should be well.

All this just as correction. I didn't test the above though, just
seems to be the most reasonable way I can think of, after base-config.

Regards, Bruno.



Reply to: