~# timedatectl //查看和更改系统的时间和日期的命令 Local time: Tue 2020-12-08 03:09:35 GMT Universal time: Tue 2020-12-08 03:09:35 UTC RTC time: Tue 2020-12-08 03:09:36 Time zone: Europe/London (GMT, +0000) //当前时区 System clock synchronized: yes NTP service: active RTC in local TZ: no
使用ls命令通过检查符号链接指向的路径来找到时区
1 2
~# ls -l /etc/localtime lrwxrwxrwx 1 root root 33 Aug 2 12:19 /etc/localtime -> /usr/share/zoneinfo/Europe/London //当前时区
~# timedatectl Local time: Tue 2020-12-08 11:20:36 CST Universal time: Tue 2020-12-08 03:20:36 UTC RTC time: Tue 2020-12-08 03:20:37 Time zone: Asia/Shanghai (CST, +0800) //更改后的时区 System clock synchronized: yes NTP service: active RTC in local TZ: no