Linux VPS Server System Date Time modification method

Source: Internet
Author: User
Tags time and date vps vps server

If we use the U.S. VPS Host Station we will find some VPS, some sites submitted time and we are different, the adoption of the United States time, rather than the Beijing time we need, this problem is mainly due to the current VPS system time zone settings problem. We need to manually adjust to solve the problem.

First step, modify system date

Date-s 04/09/2014

We set the date of the system to today September 4, 2014

Step two, modify the current system time

Date-s 12:41:20

Set current time, hour, minute, second

Step three, replace the time zone and edit

Cp-f/usr/share/zoneinfo/asia/shanghai/etc/localtime

Vi/etc/sysconfig/clock

Add the following to the clock file

Zone= "Asia/shanghai"

Finally, we use the date command to look at the current time in line with Beijing time.

Add some examples of Linux time fixes

Correction of time zone

Rm-rf/etc/localtime #删除当前默认时区www. 111cn.net
Ln-s/usr/share/zoneinfo/asia/shanghai/etc/localtime
#复制替换默认时区为上海

SSH executes the above command to change the VPS time zone to Shanghai's time zone, and, of course, to set up Hong Kong or Beijing in China.


Second, manual correction time

Date-s ' 09:16:00 2013-01-21 '

Using the date command, the modification time and date is January 21, 2013, and the time is 9:16 A.M. 0 seconds.


Three, time automatic synchronization and correction

Yum install-y NTP #安装时间同步服务 (components)
Ntpdate us.pool.ntp.org #设置同步服务器
Date #查看当前时间www. 111cn.net

The NTP service is already installed in some systems, and the NTP server correction time is automatically connected based on the time zone (first operation) of the current record.

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.