---- We generally use the "date -s" command to modify the system time. For example, set the system time to the command of June 10, 1996 as follows.
#date -s 06/10/96
Set the system time to 1:12 in the afternoon, the order is as follows.
#date -s 13:12:00
---- Note that this is the system time, which is Linux maintained by the operating system.
---- When the system is started, the Linux operating system reads the time from the CMOS to the system time variable, and the time modification time is achieved by modifying the system time. In order to maintain the consistency of system time and CMOS time, Linux writes the system time to CMOS every other period of time. Since the synchronization is performed every time (approximately 11 minutes), after we execute Date -S, if the machine is restacked, the modification time may not be written to CMOS, which is the cause of the problem. If you want to make sure the modification takes effect, you can do the following command.
---- #Clock -w
---- This command enforces the system time to CMOS