2011年(28)
分类: LINUX
2011-01-11 12:49:22
查询现在的时间
date "+%Y%m%d%H%M.%S"
%Y->年
%m->月
%d->日
%H->时
%M->分
%S->秒
查出来后可直接下指令改 date 200907081058.30
直接改日期
date -s 2009/07/08
或直接改时间
date -s 10:58:30
有连上internet的话可用NTP校时
ntpdate watch.stdtime.gov.tw
或
ntpdate time.stdtime.gov.tw
[root@linux ~]# vi /etc/crontab
00 5 * * * root /usr/sbin/ntpdate tock.stdtime.gov.tw && /sbin/hwclock -w
#每天早上五点对时并写入到BIOS里
国外的校时服务器列表:
参考自
Please note that these servers support only Network Time Protocol (Internet RFC-1305a) and Simple Network Time Protocol (SNTP).
U.S. EASTERN TIME ZONE
ntp2.usno.navy.mil
tock.usno.navy.mil
tick.usno.navy.mil
ntp-s1.cise.ufl.edu (CNAME ntp-ufl.usno.navy.mil)
ntp.colby.edu (CNAME ntp-colby.usno.navy.mil)
navobs1.oar.net (CNAME ntp-oar.usno.navy.mil)
gnomon.cc.columbia.edu (CNAME ntp-cu.usno.navy.mil)
tick.gatech.edu (CNAME ntp-gatech.usno.navy.mil)
navobs1.mit.edu (CNAMES ntp-mit.usno.navy.mil, tick.mit.edu)
U.S. CENTRAL TIME ZONE
now.cis.okstate.edu
ntp0.mcs.anl.gov (CNAME ntp-anl.usno.navy.mil)
navobs1.wustl.edu (CNAME ntp-wustl.usno.navy.mil)
tick.uh.edu (CNAME ntp-uh.usno.navy.mil)
U.S. MOUNTAIN TIME ZONE
tick.usnogps.navy.mil (CNAME tick.usnogps.navy.mil)
tock.usnogps.navy.mil (CNAME tock.usnogps.navy.mil)
U.S. PACIFIC TIME ZONE
montpelier.caltech.edu (CNAME ntp-caltech.usno.navy.mil)
bigben.cac.washington.edu (CNAME ntp-uw.usno.navy.mil)
tick.ucla.edu (CNAME ntp-ucla.usno.navy.mil)
usno.pa-x.dec.com (CNAME ntp-dec.usno.navy.mil)
ALASKA TIME ZONE
ntp.alaska.edu (CNAME ntp-ua.usno.navy.mil)
HAWAII TIME ZONE
tick.mhpcc.hpc.mil