第一步:查询服务器时间
-
[root@localhost ~]# timedatectl
-
Local time: Sat 2018-03-31 01:11:46 UTC
-
Universal time: Sat 2018-03-31 01:11:46 UTC
-
RTC time: Sat 2018-03-31 01:11:36
-
Time zone: Universal (UTC, +0000)
-
NTP enabled: yes
-
NTP synchronized: yes
-
RTC in local TZ: no
-
DST active: n/a
第二步;修改时区为Asia/Shanghai
[root@localhost ~]# timedatectl set-timezone Asia/Shanghai
第三步:查看修改后的结果
-
[root@localhost ~]# timedatectl
-
Local time: Sat 2018-03-31 09:13:21 CST
-
Universal time: Sat 2018-03-31 01:13:21 UTC
-
RTC time: Sat 2018-03-31 01:13:11
-
Time zone: Asia/Shanghai (CST, +0800)
-
NTP enabled: yes
-
NTP synchronized: yes
-
RTC in local TZ: no
-
DST active: n/a
[root@9c7b1536e1de bin]# date
Tue Aug 7 16:25:19 CST 2018
[root@9c7b1536e1de bin]#