How to Prevent Ubuntu from Setting BIOS Clock to UTC
I have a dual-boot computer that boots Ubuntu and Windows 7. Whenever I boot into Ubuntu, the BIOS clock is automatically set to UTC time, even though my current timezone is UTC+8.
Microsoft Windows on other hand, assumes that the BIOS clock contains the local time. I am not sure if there’s a way to make Windows assume that the BIOS time is set to UTC, but I have found a way to prevent Ubuntu from setting the BIOS clock to UTC.
Ubuntu has a variable settings file called
rcS in the /etc/default directory. This file contains variables that affect the behaviour of startup scripts. One of the variables is the ‘UTC’ paramater. This parameter is used to govern how the BIOS or hardware clock is intepreted. If it’s set to ‘no’ then the system clock is assumed to be set to local time. If it’s set to ‘yes’ then it’s assumed to be set to UTC time.
To let Ubuntu interpret the system clock as local time, the ‘UTC’ parameter has to be set to ‘no’. To update the parameter in the file, either use an editor to make the changes or modify the file by using the
sed command in a terminal windows as shown in the example below.
ibrahim@anfield:~$ sudo bash [sudo] password for ibrahim: root@anfield:~# sed 's/UTC=yes/UTC=no/' /etc/default/rcS > /tmp/rcS root@anfield:~# mv -f /tmp/rcS /etc/default/rcS
To update the BIOS time to localtime, run hwclock as follows:
root@anfield:~# hwclock --hctosys --localtime