centos系统设置同步时间

上海市区设置

1
2
3
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

echo 'Asia/Shanghai' >/etc/timezone

安装ntpdate工具

1
yum -y install ntp ntpdate

设置系统时间与网络时间同步

1
2
3
ntpdate cn.pool.ntp.org

or =>   ntpdate -u ntp.api.bz

将系统时间写入硬件时间

1
hwclock --systohc

4.查看硬件时

1
hwclock --show