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

ibrahim = {
interested_in(unix, linux, android, open_source, reverse_engineering);
coding(c, shell, perl, php, python, java, javascript, nodejs, angular, react);
plays_on(xbox, ps4);

  • max

    Dear IBRAHIM, the article is excellent. Can you tell that how can we change the hardware clock from 12 to 24 hour format? If it is 12 hour format than scheduling(cron) is not working.
    example: */30 08-21 * * 0-4,6 root /

  • Om Prakash

    You are a life saver man. Awesome. I searched a lot then finally got the solution.

  • Abu Nabila Erwien Tjipta

    assalammualaikum my brother, thank U for your article. my problem solved