Modify the time zone in Linux (1)

Source: Internet
Author: User

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. Clock and hwclock are similar in usage, except that clock commands support both x86 and Alpha hardware systems.

1. date

View system time

# Date

Set system time

# Date -- set = "07/07/06 10:19" month/day/year hour: minute: second)

2. hwclock/clock

View hardware time

# Hwclock -- show

# Clock -- show

Set hardware time

# Hwclock -- set -- date = "07/07/06" month/day/year hour: minute: second)

# 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 -- hctosyshc indicates the hardware time, and sys indicates the system time)

Or

# Clock -- hctosys

System clock and hardware clock synchronization:

# Hwclock -- systohc

Or

# Clock -- systohc

4. Time Zone settings

# Tzselect

Please identify a location so that time zone rules can be set correctly.

Please select a continent or ocean.

1) Africa

2) Americas

3) Antarctica

4) Arctic Ocean

5) Asia

6) Atlantic Ocean

7) Australia

8) Europe

9) Indian Ocean

10) Pacific Ocean

11) none-I want to specify the time zone using the Posix TZ format.


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.