zoukankan      html  css  js  c++  java
  • linux 修改系统时间 同步网络时间

    一、date命令

    date -s time  修改系统时钟时间为time
    设置时间和日期
    例如:将系统日期设定成2018年6月8日的命令
    命令 : "date -s 06/08/2018"
    将系统时间设定成下午10点46分03秒的命令
    命令 : "date -s 10:46:03"
    二、hwclock命令
    hwclock/clock查看、设置硬件时间
    查看系统硬件时钟
    设置硬件时间
     hwclock --set --date="06/18/14 14:55" (月/日/年时:分:秒)或者# clock --set --date="06/18/14 14:55" (月/日/年时:分:秒)
    服务器时间设置
    ntpdate time.nuri.net(若time.nuri.net不能用 还有其他的可以使用)如:
    time.nist.gov
    0.asia.pool.ntp.org
    1.asia.pool.ntp.org
    2.asia.pool.ntp.org
    3.asia.pool.ntp.org
    同步网路时间
    硬件时钟与系统时钟同步:
    # hwclock --hctosys 或者 # clock --hctosys  hc代表硬件时间,sys代表系统时间,即用硬件时钟同步系统时钟
    系统时钟和硬件时钟同步:
    # hwclock --systohc或者# clock --systohc  即用系统时钟同步硬件时钟

     
     
  • 相关阅读:
    PIL PNG格式通道问题的解决方法
    opencv-python 学习初探2 去图片水印
    Appium、selenium与Robot Framework
    性能监控0
    XML
    Python3 读取和写入excel
    Python识别字符型图片验证码
    python进程、线程、协程
    算法和程序
    Zigbee
  • 原文地址:https://www.cnblogs.com/xmao/p/12089340.html
Copyright © 2011-2022 走看看