Based on the NTP network pair,
Java code
The code is as follows:
#date-R
November 18, 2012 Sunday 19:33 23 cstlinux The tool for using network pairs under the system is ntpdate, and if Ntpdate is not installed, ntpdate must be installed: under CentOS:
Java code
The code is as follows:
#yum-y Install ntpdate NTP
Under Debian or Ubuntu:
Java code
#sudo apt-get install-y ntpdate ntpntpdate
After installation, you can use Ntpdate to update the Linux system (when we use Windows Time server pair):
Java code
The code is as follows:
#ntpdate time.windows.com
Change the time zone for a VPS
If the VPS defaults to a non-China time zone, the following command can be used to change to the China time zone:
Java code
The code is as follows:
#cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
Note: Under the OpenVZ VPS, only the time zone can be modified, but the VPS cannot be modified. Because the OpenVZ time is synchronized with the VPS server. If you find your OpenVZ VPS time is not correct, you can notify the VPS vendors to come to the right time.