Practical date and time modification method, practical date modification method
Date and Time Modification
1. view the time and date
[Root @ qdy ~] # Date Monday, January 1, December 04, 2017 10:02:12 CST
Or
[Root @ qdy ~] # Clock-0.517451 seconds
Show Calendar
[Root @ qdy ~] # Cal October 17, 910 5 6 1 2 3 4 6 7 8 1617 11 12 13 14 15 2324 18 19 20 21 22 3031 25 26 27 28 29
2. Set the time and date
For example, set the system date to November 3, 2017.
[Root @ qdy ~] # Date-s 2017/12/042017-July 22, December 04 00:00:00 CST
Set the system time to 11:45:50.
[Root @ qdy ~] # Date-s 10:12:50 December 04 CST
3. After the system time is set, you also need to synchronize it to the hardware clock and write the current time and date to the BIOS to avoid failure after restart,
[Root @ qdy ~] # Hwclock-w
Or
[Root @ qdy ~] # Clock -- systohc
In the preceding command, -- hctosys indicates Hardware Clock to SYStem clock.