[Linux-aus] Dual-booting Win*/*nix with UTC BIOS Clock

Jeremy Visser jeremy at visser.name
Sat Nov 16 15:11:59 EST 2013


On 17 Nov 2013, at 1:42 am, Peter Lawler <linux-aus at bleeter.id.au> wrote:
> Last time I looked, I recall MS had decided on insisting system clocks 
> be in local time. It certainly explains why Win* boots in one time zone, 
> the same as it logs in as, but then flips '($X*$Y) / ($moon phase^2)' 
> seconds after loading the desktop.

While it is possible to tell Windows to recognise the BIOS clock as UTC via a registry hack (set HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation\RealTimeIsUniversal to DWORD 0x1), in practice I find this to be very glitchy sometimes (e.g. worked fine for me on XP and Vista, but on Win 7 it would randomly jump forwards/backwards 10 hours at a time during the day — yes, while powered on and without rebooting!).

You are far better off telling Linux to use local time.

The /etc/adjtime is a drift file that also stores whether the hwclock is in UTC or local time. Changing this is easy as pie:

  # hwclock --adjust --localtime
  # cat /etc/adjtime 
  36.354403 1384535046 0.000000
  1384574625
  LOCAL

Or to change to UTC:

  # hwclock --adjust —utc
  # cat /etc/adjtime 
  36.354403 1384574668 0.000000
  1384574625
  UTC

The hwclock init script (at least, the one in Debian) reads that line to correctly set the system clock on boot up, so with any luck, that will work.




More information about the linux-aus mailing list