Time Tuning for Linux systems

Source: Internet
Author: User
Tags set time

In CentOS, for example, other systems should be the same or similar.

Need to use two commands: Date and Hwclock

Where the date command is provided by coreutils this package, the Hwclock command is provided by the Util-linux package. Look at these two package names should be able to feel that both packages are very basic packages, so don't worry about your Linux distribution version does not have these two commands.

First say set the time, set the time to use the date command.

Here's an example: Date-s "2015-12-21 13:30"

The string representing the time can be in a number of formats, with reference to the manual.

The above command only sets "system time" and does not change "hardware time". It is said that if the system time is only set, the system will re-read the hardware from the hardware at the next boot time, causing the set time to expire after a reboot. I didn't try it, I felt quite justified.

The personal understanding of "system time" and "Hardware Time" is that the hardware time is the time we see when we enter the BIOS, and that it is able to move forward is dependent on the button battery on the motherboard. And for "system time", is the system at boot time from the hardware there synchronized a "hardware Time", The time standard after system start depends on "system time", and "system time" can be pushed forward to rely on system operation.

The interaction between system time and hardware time can use the Hwclock command:

As an example, use hardware time to modify the system time: Hwclock--hctosys

Use system time to modify hardware time: Hwclock--SYSTOHC

View hardware time: Hwclock--show

These few usages of these two commands should be able to meet the simple requirements, Hwclock--UTC This seems to be using UTC time, not yet scrutiny UTC time is what.

Time Tuning for Linux systems

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.