How to permanently change the system time in a Linux system

In Centos system, the system time and hardware time must be modified at the same time to ensure that the modification is effective. Simply using the date command to modify the system time will take effect immediately, and the system will be restored after restarting. The specific operations are as follows:

1.date {check the current local time}
2.hwclock --show {check the hardware time}
3. If the hardware time is different from the system time, then modify the
hwclock --set --date '2014-12-15 15:15:15'
hardware time {set the hardware time to December 15, 2014
15:15:15 each day } 5.hwclock --hctosys {set system time and hardware time synchronization}
6.clock -w {save clock}

Need to reconnect twice

Guess you like

Origin blog.csdn.net/Fengfgg/article/details/113512138