iverson-3
1. 
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime  // 两句是等效的
 
2.
# timedatectl set-timezone Asia/Shanghai   //修改时区为Asia/Shanghai
# timedatectl   //查询服务器时间
 
3. 
# tzselect   // 然后根据提示进行选择:5,9,1,1
# 最后提示以下信息
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

查询时间后,仍然没有改过来。

 

安装提示操作:

# export TZ=\'Asia/Shanghai\'  // 测试后,发现只是临时有效,重启后不起作用了

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-07-18
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2021-12-15
  • 2022-02-01
猜你喜欢
  • 2021-09-21
  • 2022-12-23
  • 2021-12-15
  • 2022-12-23
  • 2021-08-22
  • 2022-12-23
  • 2021-07-15
相关资源
相似解决方案