CentOS 7系统时间与实际时间差8个小时

1、查看系统时间:

1 [root@localhost sysconfig]# timedatectl
2       Local time: 一 2017-11-06 21:13:19 CST
3   Universal time: 一 2017-11-06 13:13:19 UTC
4         RTC time: 一 2017-11-06 13:13:19
5        Time zone: Asia/Shanghai (CST, +0800)
6      NTP enabled: no
7 NTP synchronized: no
8  RTC in local TZ: no
9       DST active: n/a

发现系统时间和Universal time时间相差8个小时;

2、查看系统时区:

1 [root@localhost sysconfig]# ls /usr/share/zoneinfo/
2 Africa      Brazil   Egypt    GB-Eire    HST          Japan      Navajo    posixrules  Turkey     zone1970.tab
3 America     Canada   Eire     GMT        Iceland      Kwaj

3、删除当前系统所处的分区:

[root@localhost sysconfig]# sudo rm /etc/localtime

4、从/usr/share/zoneinfo/中创建软连接以替换当前的时区信息,直接选择Universal:

[root@localhost sysconfig]# sudo ln -s /usr/share/zoneinfo/Universal /etc/localtime

5、再次查看系统时间

1 [root@localhost sysconfig]# sudo timedatectl
2       Local time: 一 2017-11-06 13:14:32 UTC
3   Universal time: 一 2017-11-06 13:14:32 UTC
4         RTC time: 一 2017-11-06 13:14:32
5        Time zone: Universal (UTC, +0000)
6      NTP enabled: no
7 NTP synchronized: no
8  RTC in local TZ: no
9       DST active: n/a

参考:https://blog.csdn.net/lin521lh/article/details/78456654

猜你喜欢

转载自www.cnblogs.com/116970u/p/11297161.html