查詢現在的時間
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裡
國外的校時伺服器列表:
參考自 http://tycho.usno.navy.mil/ntp.html
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
沒有留言:
張貼留言