Wednesday, October 22, 2008

Time conflicts in Dual-boot, UTC or Local time in BIOS?

I'm surprised that I've used dual-boot many times but I've just found this problem. There is a problem about time between Windows and others such as Debian.

The problem is
Debian (or unix-like) uses time in BIOS as UTC time
but
Windows uses time in BIOS as local time.

So the problem shows out. I'm in Thailand so my timezone is +7. If UTC time is 10:00, I boot to Debian then the time in BIOS should be 10:00 and Debian shows 17:00 as a time. Then I switch to windows , it shows the time 10:00 as my time. The time is in the past. I adjust to the right time 17:00 and windows sets it in BIOS too. If I switched to Debian again, it will show the time is 00:00 (17:00+7 hours). That's it.

The root of the problem is each OS treat time in BIOS in different ways.
So the question is "Which time should be in BIOS? UTC or local time?"

UTC - more standards and every systems can treat it in their way. It makes sense.
Local time - After I googled , why windows does it like that, there are reasons. First is backward compatibility. The former windows system such as MS-DOS or Windows 3.1 do this way so they have to do the same way to remain compatibilites and can dual-boot between Windows' family. Last is to avoid confusing on BIOS time itself. If you're in the BIOS setting and you've to set the BIOS time. Which time will you set? your local time or UTC. It makes sense that you will set it by local time. If BIOS asks you UTC time, it's a bit strange.

So I still don't know the answer of this question. But there are some workarounds to fix this problems
You need to do only one of these.

In Linux :

Edit /etc/default/rcS
by set UTC=Yes to UTC=No

or

In Windows:

Add the registry
HKEY_LOCAL_MACHINE System CurrentControlSet Control TimeZoneInformation RealTimeIsUniversal
and set its value to 1.
Uncheck the "Automatically synchronize with an Internet time server" in Date and Time Properties.

*I don't recommend this way because I found many people told about few following problems.

but I still don't know why I didn't found this problem when I was dual-booting Ubuntu and Windows. OR Didn't I notice this problem?