Permanent modification of system time under CentOS


When using CentOS, if the local time cannot be matched, directly click the command: date – s “2017-01-05 10:15:15” takes effect immediately, but after the restart, the system time is still the same.

After looking up the information, make a summary

My CentOS is installed on a virtual machine. There are subsystem time and hardware time in virtual machine. One of the changes is that there is no way to work and both must be changed. {view current local time}

2.hwclock –show{time to view hardware}

3. If the time of hardware is not right, modify the time of hardware

4.hwclock –set –date ‘014-12-15 15:15:15’Set hardware time {

5.hwclock  –hctosys {set system time and hardware time synchronization}

6.clock -wSave clock

7. Finally, by restarting,init 6 After a quick restart, check whether the system time really takes effect!!!! One