您的位置:首页 > 运维架构 > Linux

Linux 设置时区

2018-02-22 15:57 316 查看
tzselect
将 UTC 改成CST
1. # tzselect
依次输入数字  5 9 1 1 设置为 China Standard Timezone
2. 永久化
You can make this change permanent for yourself by appending the line
TZ='Asia/Beijing'; export TZ
to the file '.profile' in your home directory; then log out and log in again.

vi /etc/profile
添加  TZ='Asia/Beijing'; export TZ,之后 souce /etc/profile,使之生效
也可以一句话写完 :
echo "TZ='Asia/Beijing'; export TZ" >> /etc/profile; source /etc/profile
解释下: >> 为 追加,,> 是覆盖,慎用,此处用 >>
3. date 检查时区是否已更改
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Linux