基于【 centos7】二 || 系统时间与网络时间同步

时间:2023-03-09 18:09:53
基于【 centos7】二 || 系统时间与网络时间同步
# date // 查看系统时间
#hwclock // 查看硬件时间 # yum -y install ntp ntpdate 安装ntpdate工具 # ntpdate cn.pool.ntp.org 设置系统时间与网络时间同步 # hwclock --systohc 将系统时间写入硬件时间 timedatectl # 查看系统时间方面的各种状态
timedatectl list-timezones # 列出所有时区 timedatectl set-local-rtc 1 # 将硬件时钟调整为与本地时钟一致, 0 为设置为 UTC 时间 timedatectl set-timezone Asia/Shanghai # 设置系统时区为上海