QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3775|回复: 8

etch如何修改硬件时钟?

[复制链接]
发表于 2006-10-20 22:57:07 | 显示全部楼层 |阅读模式
etch如何修改硬件时钟?
BIOS里的时间已经设置为北京时间
date显示的时间也正确。而且通过“ntpdate 210.72.145.44”校准的误差也可忽略不计。证明系统时钟没问题
可是每次启动后,hwclock显示的时间总是要快8个小时,而且/etc/adjtime的内容含有UTC字样。应该是系统把BIOS里的时间当成是UTC了,通过时区的设置,每次启动后都调整成BIOS时间+8
“hwclock --systohc”后。每次启动后hwclock的显示结果正确了。但是BIOS里的时间就慢了8个小时

简言之就是,系统时钟没问题。怎么修改硬件时钟为本地时间,而且确保每次启动都还是使用本地时间?
发表于 2006-10-22 18:15:12 | 显示全部楼层
http://www.debian.org/doc/manuals/system-administrator/ch-sysadmin-time.html

先看看先
回复

使用道具 举报

发表于 2006-10-22 18:16:39 | 显示全部楼层
The hwclock command provides the interface to the hardware clock. If you are wanting to ensure the correct time then with a default Debian set up it is recommended that you use ntp instead if you can. When you reboot the system will save the current correct time to the hardware clock.

Anyhow, the --adjust option of the hwclock command checks information stored in the configuration file /etc/adjtime and makes an actual correction to the time stored in the hardware clock to account for the drift that it (the hwclock utility) has been monitoring. (Each time you set the hardware clock with the hwclock command the current time is compared to the previous time it was corrected to determine the amount of drift.) Thus, when setting the system clock from the hardware clock it is advisable to do the following:



# hwclock --adjust
# hwclock --hctosys






When updating the hardware clock from an accurate system clock do:



# hwclock --systohc





补充一下
回复

使用道具 举报

 楼主| 发表于 2006-10-23 13:54:06 | 显示全部楼层
试过了,就是不行才会来问的
hwclock --systohc --localtime后,时间对了。/etc/adjtime的矫正时间也是LOCAL了。但是只要一重起,硬件时间就又出现8小时的偏差了,/etc/adjtime的矫正时间又变成UTC了
应该是debian的某个启动脚本包含了同步硬件时间的命令。但是同步到的是UTC
好像是安装之前没有校对BIOS时间,BIOS里用的是UTC时间,但是安装系统的时候用的是CST。所以才导致此问题
考虑是否要重装系统
回复

使用道具 举报

发表于 2006-10-24 15:23:07 | 显示全部楼层
不会吧, 写一条到rc里去算了
回复

使用道具 举报

 楼主| 发表于 2006-10-26 23:20:01 | 显示全部楼层
系统安装版一哥们给了答案
你要改 /etc/default/rcS 这个文件里边的 `UTC=no‘ 应该就行了

http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=169065&highlight=
回复

使用道具 举报

发表于 2006-10-27 08:30:01 | 显示全部楼层
[quote:a49df6b39f="cnhnln"]系统安装版一哥们给了答案
你要改 /etc/default/rcS 这个文件里边的 `UTC=no‘ 应该就行了

http://www.linuxfans.org/nuke/modules.php?name=Forums&file=viewtopic&t=169065&highlight=[/quote]

正解.
回复

使用道具 举报

 楼主| 发表于 2006-10-27 13:14:23 | 显示全部楼层
不知为何,我的另一台sid的机器没有此问题
回复

使用道具 举报

发表于 2007-9-27 14:52:29 | 显示全部楼层
debian 下一般的默认时间格式是CST
如果不幸是UTC
可执行这个命令 轻松搞定
apt-get install tzdata
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-3-29 01:54 , Processed in 0.069921 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表