Time configuration command timedatectl added in CentOS7

Source: Internet
Author: User

Time configuration command timedatectl added in CentOS7
Several clock definitions:

Real-time clock RTC real-time clock

The hardware clock is specified. It is generally a special circuit on the motherboard. It is used to record the power of a battery. It is not affected by the server's enabling or disabling, but the operating system's disabling.

System clock

The internal clock of the operating system. The initial value is the real-time clock, which is maintained by the kernel. It has nothing to do with RTC after the system is started.

Coordinated Universal Time (UTC) Universal clock

The system time is always UTC, and is converted to the local time when the application is using it. The local time is actually your own time zone, including the time zone. In practice, RTC can be set to the local time in UTC, generally, UTC is supported.

Use the timedatectl command:

View Current Time

[Root @ localhost ~] # Timedatectl

Local time: Mon 2015-03-23 15:31:02 CST

Universal time: Mon 2015-03-23 07:31:02 UTC

RTC time: Mon 2015-03-23 07:31:02

Timezone: Asia/Shanghai (CST, + 0800)

NTP enabled: yes

NTP synchronized: yes

RTC in local TZ: no

DST active: n/

Modification time

Timedatectl set-time 23:36:00

Modification date

Timedatectl set-time YYYY-MM-DD

Use this command to reset the time To 00:00:00


Run the following command to modify the time and date:

Timedatectl set-time '2017-03-25 23:26:00'

Modify Time Zone

List available time zones

Timedatectl list-timezones

Modify Time Zone

Timedatectl set-timezone time_zone

Set whether to synchronize with the NTP server

Timedatectl set-ntp yes

Do not want to synchronize with NTP to no

You can set the remote server time by adding the-H parameter.

You can also use the date and hwclock commands. This is a common command, which is not described in detail.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.