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