一、使用命令修改系统时区
1.修改系统正确时间
[root@tianyi ~]# date -s "2021-12-16 23:07"
[root@tianyi ~]# date "+%Y-%m-%d %H:%M:%S"
2021-12-16 23:10:32
2.修改时区
[root@tianyi ~]# timedatectl list-timezones |grep Shang
Asia/Shanghai
[root@tianyi ~]# timedatectl set-timezone Asia/Shanghai
二、通过修改相关文件方法
[root@docker ~]# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
[root@docker ~]# date
Thu Dec 16 23:58:24 CST 2021
[root@docker ~]# ll /etc/localtime
lrwxrwxrwx 1 root root 33 May 31 2021 /etc/localtime -> /usr/share/zoneinfo/Asia/Shanghai
CST: chaina standard time