我有一台 Linux Redhat 机器
# more /etc/redhat-release
Red Hat Enterprise Linux Server release 5.11 (Tikanga)
我想将时钟改为UTC 时间
所以我做了一些小测试
# date -u
Tue Jul 26 10:01:53 UTC 2016
more /etc/sysconfig/clock
ZONE="Asia/Tokyo"
hwclock --show
Tue Jul 26 19:02:17 2016 -0.768566 seconds
现在我将把时钟设置为世界标准时间
hwclock --systohc --utc
但时钟没有改变世界标准时间时间 ?
# hwclock --show
Tue Jul 26 19:02:56 2016 -0.534987 seconds
我也改变了/etc/sysconfig/时钟并附加行UTC=是
# vi /etc/sysconfig/clock
# more /etc/sysconfig/clock
ZONE="Asia/Tokyo"
UTC=yes
但从hwclock——显示我得不到世界标准时间时间
# hwclock --show
Tue Jul 26 19:06:56 2016 -0.786752 seconds
我再次尝试以下命令,但没有成功
# hwclock --systohc --utc
# hwclock --show
Tue Jul 26 19:07:07 2016 -0.399765 seconds
我重新启动机器,看看是否世界标准时间hwclock 重启后但没有成功
# reboot
Broadcast message from root (pts/0) (Tue Jul 26 19:07:13 2016):
The system is going down for reboot NOW!
机器重启后,我执行以下操作,但仍然无法配置 hwclock 到世界标准时间-:(
# hwclock --show
Tue Jul 26 19:11:05 2016 -0.697674 seconds
# hwclock --systohc --utc
# hwclock --show
Tue Jul 26 19:11:15 2016 -0.838524 seconds
请告知为什么我没有得到世界标准时间使用 hwclock 命令来计时
机器硬件信息
# dmidecode | grep -i hp
Vendor: HP
Manufacturer: HP
Manufacturer: HP
HP ProLiant System/Rack Locator
HP BIOS PXE NIC PCI and MAC Information
HP BIOS iSCSI NIC PCI and MAC Information
我使用调试运行 hwclock 如下:
hwclock --systohc --utc --debug
hwclock from util-linux-2.13-pre7
Using /dev/rtc interface to clock.
Last drift adjustment done at 1469527871 seconds after 1969
Last calibration done at 1469527871 seconds after 1969
Hardware clock is on UTC time
Assuming hardware clock is kept in UTC time.
Waiting for clock tick...
/dev/rtc does not have interrupt functions. Waiting in loop for time from /dev/rtc to change
...got clock tick
Time read from Hardware Clock: 2016/07/26 11:17:36
Hw clock time : 2016/07/26 11:17:36 = 1469531856 seconds since 1969
Time elapsed since reference time has been 0.993984 seconds.
Delaying further to reach the next full second.
Setting Hardware Clock to 11:17:36 = 1469531856 seconds since 1969
ioctl(RTC_SET_TIME) was successful.
Not adjusting drift factor because it has been less than a day since the last calibration.