首页 > 其他 > 详细

修改时区

时间:2015-11-21 11:46:00      阅读:308      评论:0      收藏:0      [点我收藏+]

1:使用date命令查看时区

[root@db-server ~]# date -R
Sun, 11 Jan 2015 07:10:28 -0800
[root@db-server ~]# tzselect

2:查看clock系统配置文件

[root@db-server ~]# more /etc/sysconfig/clock
ZONE="America/Los_Angeles"
UTC=true
ARC=false
注意:tzselect命令只告诉你选择的时区的写法,并不会生效。
所以现在它还不是东8区北京时间。你可以在.profile、.bash_profile
或者/etc/profile中设置正确的TZ环境变量并导出。
例如在.bash_profile里面设置 TZ=‘Asia/Shanghai‘; export TZ并使其生效。

修改链接/etc/locatime的时区文件

 

[root@db-server ~]# ln /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ln: creating hard link `/etc/localtime‘ to `/usr/share/zoneinfo/Asia/Shanghai‘: File exists

[root@db-server ~]# rm /etc/localtime

rm: remove regular file `/etc/localtime‘? y

[root@db-server ~]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

[root@db-server ~]# date -R

Mon, 12 Jan 2015 10:56:10 +0800

修改时区

原文:http://www.cnblogs.com/guxuanqing/p/4983176.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!