How to modify the Linux system time (Date command)

Source: Internet
Author: User
How to modify the Linux system time (date command) Source: Internet anonymous time: 11-18 23:22:27 "Big small" date command can not only display the current time of the system, but also can use it to modify the system time, the following simple introduction, easy to use friends

The command format is:

Date-s Time string

For example, only the date of the system is modified, and the time is not modified (hours and seconds)

Date-s 2012-08-02

or only modified time not modified date

Date-s 10:08:00

Of course, you can also modify the date and time

Date-s "2012-05-18 04:53:00"

Note: Because there are spaces between dates and times, you must enclose them in quotation marks, or the command will give an error.

This modification only modifies the Linux system time, the time in CMOS may not have changed, so in order to insure, it is necessary to use clock-w to write the current system time to CMOS.

The relationship between system time and CMOS time. The system time is maintained by the Linux operating system; CMOS time is the time the CMOS chip is saved. When the system starts, the operating system is recorded from the CMOS readout time as the system time, and the operating system automatically writes the system time to the CMOS at every time. If you use the date command to restart the computer immediately after modifying the system time, the operating system has not synchronized the system time to the CMOS, so that after the boot is still not modified before the time, so for the sake of insurance, the most still manually use the command clock to synchronize the system time to the CMOS.

How to modify the Linux system time (Date command)

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.