Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to modify date and time in linux

Shulou Source: shulou.com Published: 2022-06-02 00:14:57 09月30日 Update

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!

Tags: Time date content command method article grammar success value interest buddy partner quotation marks more server knowledge industry information information channel channel Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Linux Shulou Tech Info OPPO Reno NVidia