{"id":104,"title":"linux\u786c\u4ef6\u65f6\u949f\u4e0e\u8f6f\u4ef6\u65f6\u949f\u540c\u6b65","good":0,"bad":0,"hit":3581,"created_at":"2014-10-26 23:04:11","content":"
\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u8fd9\u4e24\u4e2a\u65f6\u949f\u662f\u540c\u6b65\u7684\uff0c\u4f46\u6709\u65f6\u5019\u4e5f\u6709\u53ef\u80fd\u4e0d\u540c\uff0c\u5982\u679c\u4e0d\u540c\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0time error\u9519\u8bef\uff1b<\/p>
\u67e5\u770b\u8f6f\/\u786c\u4ef6\u65f6\u949f\u7684\u547d\u4ee4\u5206\u522b\u4e3adate\/hwclock<\/p>
[root@localhost hurong]# date
Sun Oct 26 07:45:38 PDT 2014
[root@localhost hurong]# hwclock
Sun 26 Oct 2014 07:45:46 AM PDT -0.053817 seconds
\u6ce8\uff1ahwclock\u9700\u8981\u5728root\u7528\u6237\u6743\u9650\u4e0b\u624d\u80fd\u8fd0\u884c\uff1b<\/p>
<\/p>
\u5229\u7528hwclock -help\u53ef\u4ee5\u67e5\u770b\u5e2e\u52a9\u4fe1\u606f<\/p>
[root@localhost hurong]# hwclock -help \u5f53\u8f6f\u4ef6\u65f6\u949f\u4e0e\u786c\u4ef6\u65f6\u95f4\u4e0d\u4e00\u6837\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u7528hwclock --hctosys\u6765\u5c06\u8f6f\u4ef6\u65f6\u949f\u4e0e\u786c\u4ef6\u65f6\u949f\u540c\u6b65<\/p> [root@localhost hurong]# hwclock --hctosys hwclock --set --date="9\/22\/96 16:45:05"<\/p> \u5982\u679c\u76f4\u63a5\u6539\u53d8\u8f6f\u4ef6\u65f6\u949f\uff0c\u5219\u4f7f\u7528date \u65f6\u95f4\u6233.\u79d2\u6570 \uff0c\u5982\uff1a<\/p> date 1223434344.23
hwclock - query and set the hardware clock (RTC)
Usage: hwclock [function] [options...]
Functions:
-h | --help show this help
-r | --show read hardware clock and print result
--set set the rtc to the time given with --date
-s | --hctosys set the system time from the hardware clock<\/strong>
-w | --systohc set the hardware clock to the current system time
--systz set the system time based on the current timezone
--adjust adjust the rtc to account for systematic drift since
the clock was last set or adjusted
--getepoch print out the kernel's hardware clock epoch value
--setepoch set the kernel's hardware clock epoch value to the
value given with --epoch
-v | --version print out the version of hwclock to stdout
Options:
-u | --utc the hardware clock is kept in UTC
--localtime the hardware clock is kept in local time
-f | --rtc=path special \/dev\/... file to use instead of default
--directisa access the ISA bus directly instead of \/dev\/rtc
--badyear ignore rtc's year because the bios is broken
--date specifies the time to which to set the hardware clock
--epoch=year specifies the year which is the beginning of the
hardware clock's epoch value
--noadjfile do not access \/etc\/adjtime. Requires the use of
either --utc or --localtime
--adjfile=path specifies the path to the adjust file (default is
\/etc\/adjtime)
--test do everything except actually updating the hardware
clock or anything else
-D | --debug debug mode
<\/p>
[root@localhost hurong]# date
Sun Oct 26 07:53:24 PDT 2014
[root@localhost hurong]# hwclock
Sun 26 Oct 2014 07:53:29 AM PDT -0.329460 seconds
\u5982\u679c\u786c\u4ef6\u65f6\u949f\u672c\u8eab\u4e0d\u5bf9\uff0c\u53ef\u4ee5\u7528hwclock --set\u6765\u8fdb\u884c\u4fee\u6539\uff0c\u4fee\u6539\u6b63\u786e\u540e\u518d\u7528hwclock --hctosys\u6765\u540c\u6b65\uff1a\u683c\u5f0f\u5982\u4e0b\uff1a\uff08\u5c06\u786c\u4ef6\u65f6\u949f\u8bbe\u7f6e\u4e3a1996\u5e749\u670822\u65e5 16\u65f645\u520605\u79d2\uff09
<\/p>
<\/p>
<\/p>"}