修改linux系统时间为CST时区

现象:

当前时间为北京时间2017-05-24 14:36:15,但是在服务器上的时间却慢了12个小时,关于在于系统时区设置为EDT,比北京时间慢了12个钟头

[root@cqs_test ~]# date;
Wed May 24 02:36:15 EDT 2017

解决:

备份系统时间包

[root@cqs_test ~]# cd /etc

[root@cqs_test etc]# mv localtime localtime.bak

创建软连接把上海时间包连过去系统时间包

[root@cqs_test etc]# ln -s /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime

查看当前时间

[root@cqs_test etc]# date
Wed May 24 15:03:58 CST 2017

如果这时候时间还不对的话,可以执行以下命令进行同步

[root@cqs etc]# ntpdate us.pool.ntp.org

安装该命令的命令

yum install -y ntpdate
---------------------
作者:奋斗_CQS
来源:CSDN
原文:https://blog.csdn.net/qiufengwuqing123/article/details/72676557
版权声明:本文为博主原创文章,转载请附上博文链接!

猜你喜欢

转载自blog.csdn.net/qq_22083251/article/details/83504875