挂载docker容器后发现修改时间不对差别是差了8个小时, 执行date指令后发现linux服务器时区为UTC
首先对时区进行修改, 修改为时区CST 与北京时间一致
[root@localhost ~]# mv /etc/localtime /etc/localtime.bak [root@localhost ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime [root@localhost ~]# date
再对时间进行修改
// 修改时间为x年x月x日: [root@localhost ~] date -s 2021/11/30 // 修改时间为x时x分: [root@localhost ~] date -s 12:32:00
结束, 大功告成, 求个赞thanks



