Home >Operation and Maintenance >Linux Operation and Maintenance >How to modify date and time in linux
How to modify the date and time in Linux: Execute the [date -s "Year-Month-Day Hour:Minute:Second"] command to successfully modify the date and time. If you want to check the time and date, just execute the [date] command directly.
The operating environment of this article: red hat enterprise linux 6.1 system, thinkpad t480 computer.
(Learning video sharing: linux video tutorial)
How to modify and check the date and time:
1. Check the time, Date
# date Fri Jan 11 14:04:10 CST 2019
2. Modification time
Syntax: date -s "hour:minute:second"
# date -s "17:20:30"
3.Modification date and time
Syntax :date -s "Year-Month-Day Hour:Minute:Second"
# date -s "2019-01-11 14:21:30"
Note: The setting time needs to be enclosed in double quotes, otherwise an error will be reported.
4. hwclock -w Write the time into the BIOS to avoid losing the set time after restarting the server.
# hwclock -w
Related recommendations: linux tutorial
The above is the detailed content of How to modify date and time in linux. For more information, please follow other related articles on the PHP Chinese website!