现象:当执行了 date命令后,发现时区属于世界标准时,不是北京时间
[root@node01 bin]# date
2021年 04月 28日 星期三 02:47:33 UTC
解决办法:
1、通过 tzselect 查询所在地理位置的时区的TZ
2、在家目录的 .bashrc 中添加 对应的环境变量,然后source .bashrc。例如 export TZ='Asia/Shanghai'
3、更改Linux的时区
sudo rm -f /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
参考:https://www.linuxprobe.com/linux-time.html