您的位置:首页 > 运维架构 > Linux

CentOS修改时区和时间

2016-06-23 13:20 465 查看

修改时区:

CentOS时区在/etc/localtime中配置,修改最简单的方式是做个链接到你所要配置的时区(可用时区列表在/usr/share/zoneinfo)

ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime


也可以直接覆盖

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


验证(查看)当前时区:

date


修改时间:

简单明了:

date MMDDhhmmYYYY


MM: two digit month number

DD: two digit date

hh: two digit hour (24 hour system)

mm: two digit minute

YYYY: four digit of year

或者

date -s '2016-06-21 21:50:00'


网络时间同步:

设置好时区之后,使用ntp同步标准时间。

ntp:网络时间协议(network time protol)

安装:

yum install ntp


同步:

ntpdate pool.ntp.org
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  centos linux