the time of Linux is divided into system clock and real time clock (hardware, or RTC). system time: Refers to the time in the current Linux kernel. hardware time: battery-powered time on the motherboard. command to view system time: #datecommand to set the system time: #date –set (Month/day/year: minutes: seconds)Example: #date –set "10/11/10 10:15"to view hardware time commands: # Hwclockcommand to set hardware time: # hwclock–set–date = (month/day/year: minutes: seconds)the above mentioned is to manually set the time to a point in time, possibly with the current network time error. Here's how to synchronize time on a time server1. Installing the Ntpdate tool# yum-y Install NTP ntpdate2. Set the system time to synchronize with the network time# ntpdate cn.pool.ntp.org3. Write system time to hardware time# Hwclock--SYSTOHC
Time synchronization for Linux