Linux下用ntp来对时

Linux下更新系统时间的命令用:ntpdate

教育网下常用的时间服务器有s1a.time.edu.cn,或者210.72.145.44

ntpdate 210.72.145.44

更多教育下的时间服务器可在这里找到: http://www.time.edu.cn/mem.htm。

如果想让系统退出时的把时间写到bios,则在/etc/conf.d/clock里有:

# If you want to set the Hardware Clock to the current System Time

# during shutdown, then say "yes" here.

CLOCK_SYSTOHC="no"

CLOCK_SYSTOHC 要为yes,否则关机时系统时间不会更新。

注意:升级系统时要注意文件/etc/conf.d/clock不要被覆盖,里面一般设有CLOCK="local",如果被覆盖了就成了UTC,这样就会出现跟windows时间不一样。