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)