linux设置系统时间为当前网络时间

1、系统时间

  date:查看当前系统时间

    修改时间:

   date -s "2020-02-02 08:09:20" 

2、硬件时间

  hwclock --show:查看当前硬件时间

3、ntpdate

  设置网络时间为当前系统时间

  1)安装工具:yum -y install ntp ntpdate

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

  3)将系统时间写入硬件时间:hwclock --systohc

注:亲测可用,修改系统时间只有超级管理员账号才可以

原文地址:https://www.cnblogs.com/taosheng-yijiu/p/13953671.html