方案一
查看时间
date
设置时间
date -s 01/23/19
date -s 10:10:45
查看硬件时间
hwclock --show
设置硬件时间
hwclock --set --date="01/23/19 10:12:11"
硬件时间和系统时间同步
hwclock --hctosys
方案二
使用ntpdate来同步时间
ntpdate 0.asia.pool.ntp.org
但是报一下错误
23 Jan 10:00:35 ntpdate[30717]: no server suitable for synchronization found
ntpdate -d 0.asia.pool.ntp.org
最后会输出以下内容
23 Jan 10:17:55 ntpdate[30772]: step time server 193.62.11.267 offset 2.190148 sec
找到最后一行的ip,在使用下面命令
ntpdate 193.62.11.267
这样就时间同步就成功了。
本文为博主原创文章,未经博主允许不得转载。
更多内容请访问:IT源点
注意:本文归作者所有,未经作者允许,不得转载