我使用以下命令更改了服务器时区:
cp /etc/localtime /root/old.timezone
rm /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Tehran /etc/localtime
但是当我检查服务器时区时它显示:
$ date
---------
Wed Apr 22 08:15:03 UTC 2015
这是错误的。
另外/etc/localtime
输出是:
TZif2UTCTZif2UTC
UTC0
如何更改服务器时区?
OS : CentOS
Version : 6.6
最佳答案
我有一个 CentOS 6.6,我做了如下
# mv localtime localtime.old
# date
Thu Apr 23 13:14:36 UTC 2015
# ln -s /usr/share/zoneinfo/Asia/Tehran /etc/localtime
# ll localtime
lrwxrwxrwx. 1 root root 31 Apr 23 17:45 localtime -> /usr/share/zoneinfo/Asia/Tehran
# date
Thu Apr 23 17:45:36 IRDT 2015
如您所见,它对我来说非常有效,我使用 root 用户进行了所有这些更改
关于linux - CentOS 6.6 更新到亚洲/德黑兰后时区没有改变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29791812/