linux系统下date命令修改时间及hwclock硬件时间

    网上同步时间

    1.  安装ntpdate工具

    # sudo apt-get install ntpdate

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

    # ntpdate cn.pool.ntp.org

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

    # hwclock –systohc


执行到第三步的时候出现一系列的帮助信息,并且提示:

hwclock takes no non-option arguments.  You supplied 1.

于是:

# sudo hwclock -w

成功!




或者如下方法:

  先在ubuntu下更新一下时间,确保时间无误:

1
2
sudo  apt-get  install  ntpdate
sudo  ntpdate  time .windows.com

  

  然后将时间更新到硬件上:

sudo hwclock --localtime --systohc

  重新进入windows10,发现时间恢复正常了!



猜你喜欢

转载自blog.csdn.net/ordream/article/details/79917398