Linux修改系统时区
1、使用tzselect命令查找需要的时区,操作步骤如下:
执行tzselect命令-->选择Asia-->选择China-->Beijing Time
最终会提示操作命令,如下图:
You can make this change permanent for yourself by appending the line
TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai
2、设置系统时区,执行如下命令
TZ='Asia/Shanghai'; export TZ
3、设置永久生效
rm -f /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
完毕,之后就算重启机器也没问题了。
本作品采用 知识共享署名-相同方式共享 4.0 国际许可协议 进行许可。
评论已关闭