Setting the Date and Time in Linux
Updated September 21, 2001
Created September 27, 2000

Setting the Date and Time in Linux Note: Just using the date command alone will not cause the date to remain after a reboot. The date command sets the Linux system clock which is separate from the hardware clock. The "hwclock --utc --systohc" command is used to update the hardware clock with the date from the Linux system clock.

Run the date command to make sure you have the correct time:


[root@server /root]# date
Thu Sep 20 11:00:06 CDT 2001
[root@server /root]# 

If you have the wrong timezone set, use "timeconfig" or "linuxconf" to set the correct timezone.

If your timezone is correct but the date and/or time needs updating, the following commands will update the date and time. The second command is needed in order to push the date and time into the PC clock.


[root@server /root]# date 092011082001
Thu Sep 20 11:08:00 CDT 2001
[root@server /root]# hwclock --utc --systohc
[root@server /root]# 




Homepage: http://www.cpqlinux.com
Site Map: http://www.cpqlinux.com/datesort.html





1