centos7 更新时间

1、下载ntpdate工具,使用该工具可以与时间服务器同步。
yum -y install ntp ntpdate

2、设置系统时间与网络时间同步。
ntpdate cn.pool.ntp.org

3.将系统时间写入硬件时间 。
hwclock --systohc

使用timedatectl 查看当前时区
timedatectl status
查看中国时区的完整名称
timedatectl list-timezones |grep Shanghai
修改为中国时区
timedatectl set-timezone Asia/Shanghai

posted @ 2022-12-08 13:36  小小白兔兔  阅读(191)  评论(0编辑  收藏  举报  来源