Linux modification Time

Source: Internet
Author: User

  1. Modify the system time.

    There are two Linux system clocks, one is the hardware clock, that is, the BIOS time, which is the time we see in CMOS setup, and the other is the system clock, which is the kernel time of the Linux system. When Linux starts, the system kernel reads the hardware clock settings, and the system clock is independent of the hardware. Sometimes we find that the system clock is inconsistent with the hardware clock, so we need to perform time synchronization and share the command usage of time settings and clock synchronization.

    The date command sets the dates to June 18, 2014

    ----Date-s 06/18/14

    Set the time to 14 points, 20 minutes, 50 seconds

    ----Date-s 14:20:50

    Set the time to June 18, 2014 14:16 30 seconds (MMDDHHMMYYYY.SS)

    ----Date 0618141614.30

  2. Hwclock/clock command to view, set hardware time

    Viewing the system hardware clock

    Hwclock--show or

    Clock--show

    Set Hardware time

    Hwclock--set--date= "06/18/14 14:55" (Month/day/year: minutes: seconds) or # clock--set--date= "06/18/14 14:55" (Month/day/year: minutes: seconds)

  3. Synchronous system and hardware clock.

    You can see that the hardware and system clocks differ by half an hour. can be synchronized using hwclock or clock,

    The hardware clock is synchronized with the system clock:

    # Hwclock--hctosys or # clock--hctosys HC represents the hardware time, SYS represents the system time, i.e. the system clock is synchronized with the hardware clock

    system clock and Hardware clock synchronization:

    # Hwclock--SYSTOHC or # clock--SYSTOHC synchronize hardware clock with system clock


Linux modification Time

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.