"Modify time zone and time" of the CentOS system optimization series

Source: Internet
Author: User
Tags time zones

the time setting has several related concepts:

1, RTC Time/Hardware time: Refers to a real-time clock (RTC) hardware Device on the motherboard, this time is no time zone information, or he said which time zone, depends on "human interpretation"

2, System time: This is the software system (this refers to the OS) cognitive time, he contains the time zone and UTC time two parts

3, RTC time, local, UTC relationship settings: As mentioned above, RTC time does not have time zone information, take most of us in the East eight area. It is now 11 o'clock in the morning, if RTC time is set to 11 points, the RTC time obviously corresponds to the local time in the East eight region, and if RTC is set to 3 in the morning, it is not difficult to see that RTC corresponds to Universal Time (known as UTC sync time)

RTC Time is maintained in the shutdown state, so it plays a leading role, and other times are borrowed by RTC time and "
The relationship with RTC Time "is calculated (assuming in the East eight zone):
RTC Time is local time: system UTC time = RTC Time-8 hours, local time = RTC Time
RTC Time is UTC time: System UTC time = RTC time, local time = RTC Time + 8 hours

In fact, it is possible to set any kind. However, notice that the Windows system defaults to the RTC time as local time, so for the sake of unification, similar settings can be made in the Linux system. If no Windows system exists, you can set the

The Gentoo settings include:

1,/usr/share/zoneinfo: Time zone files related to time zones

2,/etc/localtime and/etc/timezone: setting time zone information


Examples of specific settings:

[Email protected] ~]# Cp/usr/share/zoneinfo/asia/shanghai/etc/localtime

Cp:overwrite '/etc/localtime '? Y

[Email protected] ~]#/usr/sbin/ntpdate time.windows.com

Jul 13:20:15 ntpdate[18837]: Adjust time server 104.41.150.68 offset-0.004899 sec

[Email protected] ~]# hwclock-w

Note: Hwclock-w writes the system clock to the hardware clock


Modify time zone and time for the CentOS system optimization series

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.