6

I have dual booted pc, i always do that, this time though, i have installed crunchbang, after booting linux, windows 7 clock becomes wrong, it goes back 3 hours.

i tried to fix it and it stays fixed until i use crunchbang 11 (stable edition), then windows clock goes back 3 hours again. crunchbang clock is always fixed, on cunchbang my hardware time and the clock are the same, the timezone is correct. I don't know how to fix it.

3
  • I've run into this problem often with different OSes that expect the hardware clock to hold different values. One expects it to be UTC, for example, while another expects it to be local time. This frequently causes the clock to display wrong in one or the other. May 31, 2013 at 15:57
  • @DarthAndroid And were you able to fix it?
    – Lynob
    May 31, 2013 at 15:59
  • 1
    It's also possible to tweak things on the Windows side with a registry edit. lifehacker instructions
    – J450n
    Nov 4, 2013 at 23:29

1 Answer 1

9

The problem is that Linux by default sets the system clock to UTC time, while Windows sets it to local time.

As far as I'm aware, Windows doesn't make a distinction between system clock time and local time; there is thus no way to have Windows set the system clock to UTC, short of actually telling Windows your time zone is GMT+0.

You will therefore need to configure your Linux installation to set the system clock to localtime, which can be done via the hwclock command -- see the manual for exhaustive detail, but in general, the following command should serve:

hwclock --set --localtime --date="5/31/2013 12:34:56"

(You may also, more conveniently, be able to issue hwclock --systohc --localtime, to copy the system time to the hardware clock and clue hwclock that it's to manage the hardware clock as local time instead of UTC; on that point, you may also need to edit /etc/adjtime to let the system know that it shouldn't try to treat the system clock as UTC on startup and shutdown.)

5
  • Adjusting /etc/adjtime amounts to appending the string LOCAL to that file.
    – kostix
    May 31, 2013 at 16:21
  • @kostix Should be pretty straightforward then. (I don't know for sure; I've never had the problem, because the last time I ran a dual-boot box was ca. 1997. Especially in the age of hardware virtualization, that stuff's for the birds.) May 31, 2013 at 16:24
  • Well, I have a first-hand experience with Debian (of which CrunchBang is a derivative). I'm not too much into dual-booting myself, but prefer to keep clock at localtime mostly because low-end x86-based servers we tend to use have BIOS clock preset to localtime, so I'm just trying to lessen the possible surprise WTF factor for admins.
    – kostix
    May 31, 2013 at 17:17
  • hwclock --systohc --localtime worked! i'm a bit shocked because before that i asked the question, i made sure that hardware time and local time are the same using hwclock but i didn't use --localtime
    – Lynob
    Jun 6, 2013 at 15:11
  • 1
    Setting /etc/adjtime is not permanent at least in Crunchbang. The value resets on every reboot. But setting hwclock --systohc --localtime does preserve the value across reboots. Dec 16, 2013 at 14:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .