[HOW TO] Hardware date and Time Using hwclock

hwclock is a program that runs under Linux and sets and queries the Hardware Clock, which is often called the Real Time Clock, RTC, or CMOS clock. This is the program that most Linux systems use to get the time from the Hardware Clock and set the System Time at boot time. This program works on ISA (Intel), Alpha, Sparc, and M68K systems with or without /dev/rtc.


hwclock contains facilities for compensating for systematic drift in the Hardware Clock.


Set the hardware date and time based on the system date as shown below:

#hwclock -systohc
#hwclock --systohc -utc

Use hwclock without any parameter to view the current hardware date and time:

#hwclock

Check the clock file to verify whether the system is set for UTC:

#cat /etc/sysconfig/clock 


Reference 1: http://linux.101hacks.com/date-manipulation/hwclock/
Reference 2: http://linux.101hacks.com/date-manipulation/set-system-date-and-time/
Reference 3: http://manpages.ubuntu.com/manpages/lucid/man8/hwclock.8.html


TiếnPT - R0039

0 nhận xét:

Post a Comment