Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to modify the system time of Linux

Shulou Source: shulou.com Published: 2022-06-01 14:55:36 09月30日 Update

This article mainly explains "how to modify Linux system time". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "how to modify Linux system time" together.

---We usually use the "date -s" command to modify the system time. For example, the command to set the system time to June 10, 1996 is as follows.

#date -s 06/10/96

The command to set the system time to 1:12:00 PM is as follows.

#date -s 13:12:00

---Note that this is system time, Linux is maintained by the operating system.

At system startup, the Linux operating system reads the time from CMOS into the system time variable, and later modifies the time by modifying the system time. To keep system time consistent with CMOS time, Linux writes system time to CMOS at regular intervals. Since this synchronization is performed at intervals (approximately 11 minutes), if we restart the machine immediately after we execute date -s, it is possible that the modified time is not written into CMOS, which is the cause of the problem. To ensure that changes take effect, execute the following command.

---- #clock -w

----This command forces system time to be written to CMOS

Thank you for reading, the above is "Linux system time how to modify" the content, after the study of this article, I believe that everyone on Linux system time how to modify this problem has a deeper understanding, the specific use of the situation also needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!

Tags: Time system command learning operating system content that is problems consistency causes variables ideas situations articles more machines knowledge points articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Information Microsoft MySQL Docker Shulou Technology