查询本地时区
$ timedatectl
Local time: Tue 2019-05-07 15:37:53 CST
Universal time: Tue 2019-05-07 07:37:53 UTC
RTC time: Tue 2019-05-07 07:37:52
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
$ timtedatectl status
Local time: Tue 2019-05-07 15:37:53 CST
Universal time: Tue 2019-05-07 07:37:53 UTC
RTC time: Tue 2019-05-07 07:37:52
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: yes
NTP synchronized: yes
RTC in local TZ: no
DST active: n/a
查看时区配置文件
$ ls -l /etc/localtime
lrwxrwxrwx. 1 root root 35 May 7 15:35 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai
查找相应时区
$ timedatectl list-timezones
$ timedatectl list-timezones | egrep -o "Asia|S.*"
$ timedatectl list-timezones | egrep -o "Europe/B.*"
$ timedatectl list-timezones | egrep -o "America/N.*"
指定对应时区
$ timedatectl set-timezone Asia/Shanghai
$ timedatectl
lrwxrwxrwx. 1 root root 35 May 7 15:47 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai
$ timedatectl set-timezone Europe/Berlin
$ timedatectl
lrwxrwxrwx. 1 root root 35 May 7 09:46 /etc/localtime -> ../usr/share/zoneinfo/Europe/Berlin
How to set or change timezone on CentOS7