Introduce the method of modifying system time under Linux operating system

Source: Internet
Author: User
Tags date

We generally use the "date-s" command to modify the system time. For example, set the system time to the August 19, 2007 command as follows.

#date-S 08/19/2007

The command to set the system time to 11:20 P.M. 0 seconds is as follows.

#date-S 11:20:00

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

When the system starts, the Linux operating system reads the time from the CMOS to the system time variable, and later modifies the time by modifying the system time. To keep the system time consistent with the CMOS time, Linux writes the system time to the CMOS at intervals. Since this synchronization takes place every once in a while (about 11 minutes), after we perform date-s, if the machine is immediately reset, the modification time may not be written to CMOS, which is the cause of the problem. If you want to ensure that the changes take effect, you can execute the following command.

#clock-W

This command forces the system time to be written to the CMOS.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.