linux设置时间

设置时间:

date -s "2016-02-26 23:58:0"

恢复到正常时间:

ntpdate pool.ntp.org

在使用ntpdate过程中,遇到过问题:

 7 Feb 00:25:30 ntpdate[5648]: Can't adjust the time of day: Invalid argument

或者:

Error resolving –d: Name or service not known (-2)
 7 Feb 00:15:25 ntpdate[5355]: Can't find host –d: Name or service not known (-2)

好像这个问题是因为年份比较大而导致的,我也没找到合适的方法修复。只能重新设置一下相对较小的时间,然后重新ntpdate一下。

date --set 101010
ntpdate pool.ntp.org

 

posted @ 2016-01-27 11:42  格通  阅读(1128)  评论(0编辑  收藏  举报