【From】 https://blog.csdn.net/weixin_35852328/article/details/79506453

 

Linux的时间分为System Clock(系统时间)和Real Time Clock (硬件时间,简称RTC)。

系统时间:指当前Linux Kernel中的时间。

硬件时间:主板上有电池供电的时间。

查看系统时间的命令: #date

设置系统时间的命令: #date –set(月/日/年 时:分:秒)

例:#date –set “10/11/10 10:15”

查看硬件时间的命令: # hwclock

设置硬件时间的命令: # hwclock –set –date = (月/日/年 时:分:秒)

上述提到的是手动设置时间到一个时间点,可能与当前网络的时间有误差。下面介绍一下与时间服务器上的时间同步的方法

 

1) 安装ntpdate工具

yum -y install ntp ntpdate

 

2) 设置系统时间与网络时间同步

ntpdate cn.pool.ntp.org

or =>   ntpdate -u ntp.api.bz

 

3) 将系统时间写入硬件时间

hwclock –systohc

相关文章:

  • 2022-12-23
  • 2021-12-21
  • 2021-09-27
  • 2021-09-27
  • 2021-09-27
  • 2022-12-23
猜你喜欢
  • 2021-11-04
  • 2022-12-23
  • 2021-10-25
  • 2021-11-04
  • 2021-10-17
  • 2021-10-17
  • 2022-02-12
相关资源
相似解决方案