linux设置时间

设置时间:spa

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

恢复到正常时间:code

ntpdate pool.ntp.org

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

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

或者:class

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

date --set 101010 ntpdate pool.ntp.org
相关文章
相关标签/搜索