Then you will say, how to check my hardware time is not UTC time??
Hwclock--localtime
#如果上面这条命令的输出和UTC (GMT) time is the same, that's right, otherwise, look at the following.
Some operating systems will be very silly hwclock and localtime (is m$ if you do not know who I mean the words), of course, our advanced multi-user operating system will not do so, In general, a POSIX machine will always adjust the internal clock of the machine to UTC (Greenwich (GMT) time), and then through the Hwclock this tool at boot, from the kernel read converted to Sysclock, usually under the x86 platform, Sysclock are more accurate than hwclock.
Fart say so much, how to set the Hwclock to UTC time?
sudo cp/usr/share/zoneinfo/utc/etc/localtime
#上面这命令, set the UTC time to local time so that the Hwclock
sudo date mmddhhmm[year][. SS]
#上面这命令中时间需要是GMT时间 (or UTC time)
sudo hwclock--SYSTOHC--UTC
#上面这命令, synchronize the Sysclock to hardware time (that is, the time in the BIOS) and specify the hardware time as the UTC time Zone
sudo cp/usr/share/zoneinfo/asia/shanghai/etc/localtime
#上面这命令, set local time to Beijing time (yes, no Beijing this zoneinfo), don't believe in yourself tzselect
Date
#上面这命令, the local time will be checked
#值得玩味的是, man manual also in about--localtime, actually only with--set--SYSTOHC--ajust switch same time. Facts prove:
Hwclock--localtime #显示的是硬件时间的本地时间hwclock The true "local time" of the--UTC #显示的是当硬件时间为utc时
Resources:
Http://www.linuxfromscratch.org/hints/downloads/files/time.txt
How do I understand the output and settings of Hwclock?