How to modify time in linux

WBOY
Release: 2022-01-27 10:56:51
Original
19605 people have browsed it

In Linux, you can use the date command to modify the time. The function of this command is to display or set the date and time of the system. You can set the time according to the specified format. The syntax is "date -s modified time".

How to modify time in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to modify the time in Linux

The Linux date command can be used to display or set the system date and time. In terms of display, the user can set the format to be displayed. The format is set to A plus sign followed by several tags, the list of available tags is as follows:

How to modify time in linux

How to modify time in linux

##The syntax is:


date [-u] [-d datestr] [-s datestr] [--utc] [--universal] [--date=datestr] [--set=datestr] [--help] [--version] [+FORMAT] [MMDDhhmm[[CC]YY][.ss]]
Copy after login

Parameter description:

  • -d datestr: Display the time set in datestr (non-system time)

  • --help : Display auxiliary information

  • -s datestr : Set the system time to the time set in datestr

  • -u : Display the current Greenwich Mean Time

  • --version: Display version number

The example is as follows:


date -s 11/12/19

Modify the current date of the system to November 12, 2019. Note that this command will set your hours, minutes and seconds to 00:00:00

How to modify time in linux

date -s 23:43:20

Set your time to 23:43:20

How to modify time in linux

Related recommendations:《

Linux video tutorial

The above is the detailed content of How to modify time in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!