升级到12.10之后,本地时间一直不对,因为之前一直在整开发环境的事情,一直没有时间去解决这个问题,如今环境配好了,该回头看看这个问题了。
同样不懂问google,原来系统读取的bios时间默认设置为UTC时区,可是我查看了对应的/etc/default/rcS配置
# assume that the BIOS clock is set to UTC time (recommended)
UTC=no
但是我在选择时间的对话框中,确实看到只有选择UTC,时间才是正确的,看来还是时区不对,于是根据网上说的方法进行时区设置:
tzselect
依次根据提示选择:asia->china->shanghai
完成之后,他会有一个提示,告诉你将
TZ=‘Asia/Shanghai’; export TZ
插入到~/.profile末尾:
cat >>~/.profile<<EOF
TZ='Asia/Shanghai'; export TZ
EOF
然后将时区配置文件覆盖
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
用ntpd设置网络自动同步:
apt-getinstall-y ntp
vim /etc/ntp.conf
server 0.debian.pool.ntp.org iburst dynamic
server 1.debian.pool.ntp.org iburst dynamic
server 2.debian.pool.ntp.org iburst dynamic
server 3.debian.pool.ntp.org iburst dynamic
/etc/init.d/ntp restart
然后重启下系统,看到时间能正常同步了。
转自http://www.cnblogs.com/xiaoyaoxia/archive/2012/10/30/2746840.html