CentOS下调整系统时区

来源:互联网 发布:caffe alexnet 编辑:程序博客网 时间:2024/04/30 21:33

首先查看当前系统时区:

*[root@localhost lampp]# cat /etc/sysconfig/clock # The time zone of the system is defined by the contents of /etc/localtime.# This file is only for evaluation by system-config-date, do not rely on its# contents elsewhere.ZONE="Asia/Chongqing"*

系统显示当前时区是亚洲重庆时区,如果我们想调整时区为上海

[root@localhost lampp]# cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime cp: overwrite `/etc/localtime'? 

然后输入y,或者用

 cp /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime  -f

重启系统就好了

0 0