CentOS7 日期时间设置

设置系统时间为中国时区并启用NTP同步

// 安装ntp服务
yum install ntp 
// 开机启动服务
systemctl enable ntpd 
// 启动服务
systemctl start ntpd 
// 更改时区
timedatectl set-timezone Asia/Shanghai
// 启用ntp同步
timedatectl set-ntp yes 
// 同步时间
ntpq -p 
// 将硬件时钟调整为与本地时钟一致
timedatectl set-local-rtc 1 或 hwclock --systohc --localtime 
发布了15 篇原创文章 · 获赞 1 · 访问量 2709

猜你喜欢

转载自blog.csdn.net/u014704612/article/details/103608177