How to set the Ubuntu (software) clock to use the BIOS (hardware) clock

You notice that when you install or run Ubuntu, your time is skewed. You check the BIOS clock, its correct. So you modify the clock in Ubuntu, its now fine. But when you checked the BIOS clock, its again skewed.

There are two main clocks in a Linux system

The Hardware Clock: This is the physical clock on the BIOS, and runs even when the computer is turned off.

The System (Software) Clock: This is the time kept by the Linux kernel and run by a timer interrupt. The time is fetched initially from the hardware clock upon Linux startup, and then replaced by the kernel based time.

How to fix this so the clock is unified?

Just use the hwclock command, but set the BIOS clock to the correct time first. Then, start your machine and go to the terminal:

sudo hwclock –hctosys

Or, if you want, just set the correct time within Linux, and issue this on the terminal:

sudo hwclock –systohc

That should solve your problem.

Leave a Reply

Your email address will not be published. Required fields are marked *