转自:http://xenojoshua.com/2011/04/ubuntu10-10-date-timezone/
搞了好半天,其实现在还是没怎么搞懂如何设置时间/时区。不管了,直接写如何调整。
首先是时区,试了下命令:tzconfig。结果系统提示:
WARNING: the tzconfig command is deprecated, please use: dpkg-reconfigure tzdata
然后使用命令 dpkg-reconfigure tzdata,居然是图形界面,太棒了。。。直接选择了Asia和Shanghai,结束了。date了下,时区设置成了CST(China Standard Time)。
接下来是如何用date设时间,有个老外写的东西不错,拿来看下:
type in the following command, replacing nn with the two-digit month (01 – 12), dd with the two-digit day, hh with the two-digit hour (00 – 23), mm with the two-digit minute (00 – 59). Optionally, you can then follow that with either a two-digit or four-digit year, and/or the two-digit second. If you’re adding the seconds, put a . (period) before the seconds.
date nnddhhmmyy.ss
For instance, to set the date/time for May 19th, 2007, 6:00pm (and 0 seconds), you would type:
date 051918002007.00
最后设置下ntpdate来与服务器同步时间:ntpdate cn.pool.ntp.org
cn.pool.ntp.org是位于中国的公共NTP服务器,用来同步你的时间。
e.g. date -s “06/07/2011 16:37:00″