项目上服务器与时间服务器同步时间后,总是比实际时间快一个小时
clock
英[klɒk]
美[klɑːk]
n. 时钟; 钟;
v. 达到(某时间或速度); 测…的速度; 注意到; 认出;
首先查看时区:
date --help 获取帮助
[root@db02 ~]# date -R
Mon, 13 Aug 2018 11:10:04 +0800
[root@db02 ~]# date +%z
+0800
#我们国家的东八区(+0800)
最后的解决方案:
1.修改/etc/sysconfig/clock文件:
这个文件其实也不包含在NTP 的 daemon 当中,因为这个是 Linux 的主要时区设定文件。每次开机后,Linux 会自动的读取这个文件来设定自己系统所默认要显示的时间。
vi /etc/sysconfig/clock //执行这个命令,编辑/etc/sysconfig/clock文件
# The time zone of the system is defined by the contents of /etc/localtime.
# This file is only for evaluation by system-config-date, do not rely on its
# contents elsewhere.
ZONE="Asia/Shanghai" //这个位置把Asia/Ulaanbaatar改为Asia/Shanghai
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~