线上服务器修改时区相关内容

来源:互联网 发布:金正恩结局知乎 编辑:程序博客网 时间:2024/05/17 01:35

a. 查看时区的方法

  1. date

    [root@localhost ~]# date Fri Apr 21 07:14:49 GMT 2017
  2. date -R

    [root@localhost ~]# date  -RFri, 21 Apr 2017 07:14:47 +0000

b. 查找时区的两种方式

  1. tzselect : 比如 Asia/Shanghai

  2. 查看 /usr/share/zoneinfo/目录下时区的文件 : 比如 GMT

c. 设置时区的方法

Step 1. 将时区文件复制至/etc/localtime:

# cp /usr/share/zoneinfo/GMT /etc/localtime 

Step 2. 修改/etc/sysconfig/clock

# vim /etc/sysconfig/clock内容:    ZONE="GMT"     UTC=false     ARC=false 

Step 3. 重启crond

# /etc/init.d/crond restart 
原创粉丝点击