It is not known why the server is on the wrong system time, nearly 63 minutes faster than the actual UTC. It is easy to confuse when a timestamp checksum is involved in a local file and a remote server file.
Here, the process of correcting the system time is recorded as follows.
References: http://www.centoscn.com/CentOS/config/2015/0723/5901.html
In CentOS 7 there is a command timedatectl can help us modify the server's time zone.
1. View the time set timedatectl in the server, which is equivalent to TIMEDATECTL status:
$ timedatectl Local
time:mon 2016-08-29 16:20:35 CST
Universal Time:mon 2016-08-29 08:20:35 UTC
RTC Time:mo n 2016-08-29 08:18:07 time
Zone:asia/shanghai (CST, +0800)
NTP enabled:yes
NTP synchronized:no
RTC Local Tz:no
DST active:n/a
2. Understand the parameters of the TIMEDATECTL command:
$ timedatectl-h
timedatectl [OPTIONS ...] COMMAND ...
Query or change the system time and date settings.
-H--help Show this help message
--version Show package version--no-pager does not
pipe output into a pager
--n O-ask-password don't prompt for password-
h--host=[user@]host Operate on remote host-
m--machine=container Oper Ate on the local container
--adjust-system-clock adjust system clock when changing the local RTC mode
Commands:
STA Tus show current time settings
set-time time Set system time
Set-timezone ZONE set system time ZONE
List-ti Mezones show known time zones
SET-LOCAL-RTC BOOL Control whether RTC-in local time
SET-NTP bool Control Wheth Er NTP is enabled
3. Set time
$ sudo timedatectl set-time 15:26:58$ timedatectl local time:mon 2016-08-29 15:27:00
CST
Universal Time:mon 2016 -08-29 07:27:00 UTC
RTC time:mon 2016-08-29 07:27:00 time
Zone:asia/shanghai (CST, +0800)
NTP enabled:no
NTP synchronized:no
RTC in local tz:no
DST active:n/a
PS: See below CentOS Modify server system time
After the installation of Linux, is generally foreign world, is not convenient to set up tasks, or lead to the site to obtain local time confusion, so you need to change the server time and local time, that is, the time to change to China.
First instruction: Date–s ' 2016-10-31 10:10:10 '
Second instruction: Clock–w//write date to CMOS
Time in accordance with the above format, the operation is finished can be used
Date
View server time, if it is the same as set, it means success.
The above is a small set to introduce the CENTOS7 to modify the server system time method, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!