CentOS7 更新时间与同步时间方法

Krent
2022-02-11 / 0 评论 / 228 阅读 / 正在检测是否收录...

1、查看系统时间

date -R

2、查看硬件时间

hwclock

3、查看系统时间方面的各种状态

timedatectl

4、列出所有时区

timedatectl list-timezones

也可以使用

tzselect

5、将硬件时钟调整为与本地时钟一致, 0 为设置为UTC时间

timedatectl set-local-rtc 1

6、安装utpdate工具

yum -y install utp ntpdate

7、设置系统时间与网络时间同步
(常用NTP服务器见此文: https://www.cingetech.com/53.html

ntpdate cn.pool.ntp.org

8、将系统时间写入硬件时间

hwclock --systohc

9、设置系统时区为上海

timedatectl set-timezone Asia/Shanghai
1

评论 (0)

取消