centOS7 设置时区/同步时间
查看当前时间:
date
设置硬件时钟调整为与本地时钟一致:
timedatectl set-local-rtc 1
设置时区为上海:
timedatectl set-timezone Asia/Shanghai
安装ntpdate:
yum -y install ntpdate
使用ntpdate同步时间:
ntpdate -u pool.ntp.org
查看当前时间:
date
设置硬件时钟调整为与本地时钟一致:
timedatectl set-local-rtc 1
设置时区为上海:
timedatectl set-timezone Asia/Shanghai
安装ntpdate:
yum -y install ntpdate
使用ntpdate同步时间:
ntpdate -u pool.ntp.org