Linux system clock and hardware clock inconsistency problem __linux

Source: Internet
Author: User
In the process of using Linux, you may encounter system clock and hardware clock inconsistency, that is, Date,hwclock--show see the clock is inconsistent. The Linux clock is divided into system clocks (systems Clock) and hardware (real time Clock, short RTC) clocks. The system clock is the clock in the current Linux kernel, and the hardware clock is the battery-powered clock on the motherboard, which can be set in the BIOS. When Linux is started, the hardware clock will read the system clock settings, and the system clock will be independent of the hardware operation. All the commands (including functions) in Linux are set by the system clock. In Linux, the commands for clock viewing and setting are mainly date, hwclock, and clock.   Among them, clock and hwclock usage is similar, only use one on the line, except that the clock command supports the Alpha hardware system in addition to the x86 hardware system. If you adjust the BIOS time, which is the hardware clock.   You don't have to reboot the machine to do it in the Linux system. # Hwclock--set--date= "4/28/05 11:10:05" (Month/day/year: minute: sec) # clock--set--date= "07/07/06 10:19" (Month/day/year: minutes: SEC) If you have system time synchronized with your hardware clock, With # Hwclock--hctosys (HC for hardware time, SYS for system time) # Clock--SYSTOHC system clock and hardware clock Sync: Time zone settings # Tzselect or if you do not use the Tzselect command, you can modify the file change time zone 。 # vi/etc/sysconfig/clock Zone=asia/shanghai (/usr/share/zoneinfo file below) utc=false arc=false# rm/etc/localtime# LN-SF/   Usr/share/zoneinfo/asia/shanghai/etc/localtime can be restarted. Now let's look at the system time and hardware time is not the same. # date Hwclock also need to know a few commands, such as timeconfig time and a lot of things, it is best to look at the/etc/directory in the configuration file.
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.