您的位置:首页 > 其它

Ubuntu10.10时间/时区设置

2014-04-09 19:26 330 查看
转自: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服务器,用来同步你的时间。

使用date -s “month/day/year hour:minute:second”来设定时间。

e.g. date -s “06/07/2011 16:37:00″
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: