Making Linux time permanent

Posted on December 17th, 2007 in Howtos by Rodney

One annoying thing when you set the time on a Linux system is it quite often doesn’t seem to stay put.

The way to fix this is to set the PC clock, at the same time as the operating system. This is done as follows: (in this example, we’re going to set the time to 2:15pm on the 17th of December)

[root@selene /]# date 12171415
(this sets the time to month 12, day 17, hour 14, minute 15)
[root@selene /]# hwclock –utc –systohc
(this forces the update to the hardware clock)

P.S.
If you want to set the timezone as well, use the the command:
[root@selene /]# timeconfig
and pick your timezone. Of course, you should do this before setting the time.