If the system time is set to the December 9, 1999 command as follows.
#date-S 12/09/99
The command to set the system time to 2:18 P.M. 9 seconds is as follows.
#date-S 14:18:09
Date
The command can not only display the current time of the system, but can also use it to modify the system time.
The command format is:
Date-s time string such as modifying only the date of the system, not modifying the time (minutes 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 at the same time
Date-s "2012-05-18 04:53:00"
Note: Because there are spaces between the date and time, you must enclose them in quotation marks, otherwise the command will give an error.
The above modification only modifies the Linux system time, the CMOS time may have not changed, so for the insurance, need to use clock-w to write the current system time to the CMOS.
root operation user mode.
Method One:
Date 010318242008 (days of the Month) (full written)
Date 010318242008.30 (Month day, year.)
Method Two:
1 Set the date first
Date-s 20080103
2 "Set time
Date-s 18:24
+++++++++++++++++++++++++++++
If you want to change the BIOS time at the same time
Re-execution
Clock-w