How to set the synchronization time and time zone in Linux

Source: Internet
Author: User
Tags vps

First, revise the Beijing time zone

Here old left to modify the time zone as the default, if there are other needs, you can modify the corresponding.

The code is as follows Copy Code
Rm-rf/etc/localtime #先删除默认的时区设置
Ln-s/usr/share/zoneinfo/asia/shanghai/etc/localtime #替换上海/Beijing as Default
Second, manually modify the current system time
The code is as follows Copy Code
Date-s ' 14:48:00 2014-12-29 '

Here, the old left is modified for the current time.

Third, set synchronization time

The code is as follows Copy Code
Ntpdate us.pool.ntp.org

Set synchronization server time, after installation, we use date to test the current time.

General VPS have installed NTP, if not installed we need to first install Yum install-y NTP (CentOS system).

Summary, so that we through the above 3 steps on the fast implementation of the Linux VPS system time and the current needs of the timezone and time synchronization, to ensure the normal operation of the project.

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.