Linux command: Setting hardware clock--hwclock

Source: Internet
Author: User
Tags time and date

Function Description: Displays and sets the hardware clock.


Syntax: Hwclock [--adjust][--debug][--directisa][--hctosys][--show][--systohc][--test]

[--UTC] [--version] [--set--date=< date and time;]


Added: There are two clocks such as hardware clock and system clock in Linux. The hardware clock is the clock device on the motherboard, which is usually the clock that can be set on the BIOS screen. The system clock refers to the clock in the kernel. When Linux starts, the system clock reads the settings of the hardware clock, and then the system clock runs independently. All Linux-related instructions and functions are programmed to read the system clock.


Parameters

--adjust Hwclock is recorded in the/etc/adjtime file each time the hardware clock is changed. The--adjust parameter allows the Hwclock to estimate the deviation of the hardware clock based on previous records and use it to correct the current hardware clock.

--DEBUG displays detailed information on Hwclock execution.

--directisa Hwclock presets To access hardware clocks from/DEV/RTC devices. If not accessible, this parameter can be used to access the hardware clock directly with the I/O instruction.

The--hctosys adjusts the system clock to match the current hardware clock.

--set--date=< Date and time > Set hardware clock.

--show Displays the time and date of the hardware clock.

The--SYSTOHC adjusts the hardware clock to coincide with the current system clock.

The--test only tests the program without actually changing the hardware clock.

--UTC to use GMT, add this parameter, and Hwclock will perform the work of the conversion.

--version Displays version information.


Before setting the system date and time, make sure that the operating system time is set appropriately.

The hardware time to be set depends on the operating system time, as follows:

[Email protected] ~]# hwclock--SYSTOHC

[Email protected] ~]# hwclock--SYSTOHC--UTC

Use Hwclock without any parameters to view the current hardware date and time.

[Email protected] ~]# hwclock


This article is from the "Dragon" blog, make sure to keep this source http://1208073155.blog.51cto.com/9039381/1433476

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.