There are quite many cases where your hardware and system clock have different values (especially when you are dual booting with windows) . But let’s start with the beginning;
There are two main clocks in a Linux system;
The System Time: This is the time kept by a clock inside the Linux kernel and driven by a timer interrupt. It has meaning only while Linux is running on the machine.
The Hardware Clock: This is a clock that runs independently of any control program running in the CPU and even when the machine is powered off.
Often-times, it happens that when you reboot (especially when you are dual booting windows or other OS), your clock does not reflect the correct date and time. You may be forgetting to sync the hardware clock with the current system time. Here is how:
First check the current system date and time in order to determine if the problem is the system’s time or something else (like invalid Desktop Manager timezone settings).
# date
Then you can change the date and time
# date -s ‘Wed May 7 11:35:00 EST 2008′
or you may use the automated ntpdate in order to automatically adjust your time based on your timezone settings (for gentoo these settings are located at /etc/conf.d/clock )
#ntpdate gr.pool.ntp.org
(hint: check ntp.org to find your closest ntp server)
Then sync your hardware clock with the system time.
# hwclock –show
# hwclock –systohc
man date ntpdate and hwclock for more info…
1 comment so far
Nice thank’s, it works for mac too!
May 8th, 2008 at 10:51 am
Leave a Comment