CentOS 7 Time zone settings

Source: Internet
Author: User
Tags time zones

Time to synchronize the server for various reasons after the installation of CentOS 7 or the device time zone.


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


First we can use the TIMEDATECTL command to view the current time zone settings in the 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/a


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


We can use the command "Timedatectl list-timezones" to view all time zones


After viewing the time zone we can use the command "Timedatectl Set-timezone time zone"


For example, we need to set up a time zone in Shanghai: "Timedatectl set-timezone Asia/shanghai"


After setting the time zone, you can also set the NTP server to open and close


Turn on NTP: "Timedatectl set-ntp yes"


Turn off 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"

CentOS 7 Time zone settings

Related Article

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.