[root@xxx ~]# ll /etc/localtime
lrwxrwxrwx 1 root root 35 Jul 27 2018 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai
如果不正确,手动修改时区:
[root@xxx ~]# timedatectl set-timezone Asia/Shanghai
或者:
[root@xxx ~]# ln -sf /usr/share/zoneinfo/Universal /etc/localtime1234567
[root@xxx ~]# timedatectl
Local time: Fri 2018-07-27 00:54:04 CST 本地时间为CST
Universal time: Thu 2018-07-26 16:54:04 UTC UTC时间
RTC time: Thu 2018-07-26 16:54:04 硬件时间默认使用UTC时间
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a123456789
[root@xxx ~]# date -s '-8hour'
Thu Jul 26 16:54:30 CST 201812
[root@xxx ~]# hwclock -w
[root@xxx ~]# timedatectl
Local time: Thu 2018-07-26 16:55:11 CST
Universal time: Thu 2018-07-26 08:55:11 UTC
RTC time: Thu 2018-07-26 08:55:11
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a12345678910
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
标 题:服务器与CST时间误差8小时的解决方法