CentOS 7 Time Zone settings

Source: Internet
Author: User

CentOS 7 Time Zone settings

After CentOS 7 is installed, You need to modify the time zone of the device for various reasons or synchronize the Time of the server.

In CentOS 7, there is a command timedatectl to help us modify the time zone of the server.

First, you can use the timedatectl command to view the time zone settings on the current server:

Local time: Wed 2015-07-22 16:48:14 CST

Universal time: Wed 2015-07-22 08:48:14 UTC

Timezone: Asia/Shanghai (CST, + 0800)

NTP enabled: yes

NTP synchronized: yes

RTC in local TZ: yes

DST active: n/

You can see all the settings in the current server, such as time, time zone, NTP, etc.

Run the "timedatectllist-timezones" command to view all time zones.

After checking the time zone, we can run the "timedatectl set-timezone" command"

For example, we need to set the time zone to Shanghai: "timedatectl set-timezone Asia/Shanghai"

You can also enable or disable the NTP server after setting the time zone.

Enable NTP: "timedatectl set-ntp yes"

Disable NTP: "timedatectl set-ntp no"

Of course, the timedatectl command can also set the date and time

Set date: "timedatectl set-time YYYY-MM-DD"

Set time: "timedatectl set-time HH: MM: SS"

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.