I have linux redhat machine
# more /etc/redhat-release
Red Hat Enterprise Linux Server release 5.11 (Tikanga)
I want to change the hwclock to UTC time
So I perform little test as
# 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
And now I will set the hwclock to UTC
hwclock --systohc --utc
But the hwclock not change to UTC time ?
# hwclock --show
Tue Jul 26 19:02:56 2016 -0.534987 seconds
I also change the /etc/sysconfig/clock and append the line UTC=yes
# vi /etc/sysconfig/clock
# more /etc/sysconfig/clock
ZONE="Asia/Tokyo"
UTC=yes
But from hwclock -- show I get non UTC time
# hwclock --show
Tue Jul 26 19:06:56 2016 -0.786752 seconds
I try again by the following command but without success
# hwclock --systohc --utc
# hwclock --show
Tue Jul 26 19:07:07 2016 -0.399765 seconds
I reboot the machine to see if I get UTC hwclock after restart but without success
# reboot
Broadcast message from root (pts/0) (Tue Jul 26 19:07:13 2016):
The system is going down for reboot NOW!
After machine reboot I perform the following , but still cant configure hwclock to UTC -:(
# 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
Please advise why I not get UTC time by the hwclock command
Machine HW info
# 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
I run the hwclock with debug as:
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.
0 Answers