Linux system time and hardware Time modification

Source: Internet
Author: User
The linux system time is sometimes not synchronized with the hardware Time. Linux clocks are divided into system clock and RealTimeClock (RTC) clock. The system clock is the clock in the current LinuxKernel, while the hardware clock is the clock powered by the battery on the motherboard. the hardware clock can be entered into the linux system in the BIOS, sometimes not synchronized with the hardware time.
Linux Clock is divided into System Clock and Real Time Clock (RTC. The system clock is the current Linux Kernel clock, and the hardware clock is the battery-powered clock on the motherboard. This hardware clock can be set in the BIOS. When Linux is started, the hardware clock reads the system clock settings, and then the system clock runs independently of the hardware.
All commands (including functions) in Linux use the system clock settings. In Linux, the commands used for clock viewing and setting mainly include date, hwclock, and clock. Among them, clock and hwclock use similar, just use one line, but clock commands not only support x86 hardware system, but also support Alpha hardware system.
1. date
View system time
# Date
Set system time
# Date -- set "07/07/06" (month/day/year hour: minute: Second)
2. hwclock/clock
View hardware Time
# Hwclock -- show
Or # clock -- show
Set hardware Time
# Hwclock -- set -- date = "07/07/06" (month/day/year hour: minute: Second)
Or # clock -- set -- date = "07/07/06" (month/day/year hour: minute: Second)
3. hardware Time and system Time Synchronization
As mentioned earlier, when the system is restarted, the hardware Time reads the system time for synchronization. However, if the system time is not restarted, you need to use the hwclock or clock command to synchronize data.
Hardware clock and system clock synchronization: # hwclock -- hctosys (hc indicates hardware Time, sys indicates system time) or # clock -- hctosys
System clock and hardware clock synchronization: # hwclock -- systohc or # clock -- systohc

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.