How to modify date and time in linux
This article mainly introduces how to modify the date and time in linux, the article is very detailed, has a certain reference value, interested friends must read it!
Linux method to modify date and time: execute [date-s "year-month-day hour: minute: second"] command to modify date and time successfully. If you want to see the time and date, simply execute the [date] command.
How to modify and view the date and time:
1. Check the time and date
# dateFri Jan 11 14:04:10 CST 2019
2. Modification time
Syntax: date-s "hours: minutes: seconds"
# date-s "17:20:30"
3. Date and time of modification
Grammar: date-s "year-month-day hours: minutes: seconds"
# date-s "2019-01-11 14:21:30"
Note: the setting time needs to be enclosed in double quotation marks, otherwise an error will be reported.
4. Hwclock-w writes the time to BIOS to avoid losing the set time after restarting the server.
# hwclock-w above is all the content of the article "how to modify date and time in linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!