CentOS system optimization "modify time zone and time"

Source: Internet
Author: User
Time settings have several related concepts: 1. rtc time/hardware Time: refers to a real-time clock (rtc) hardware device on the motherboard. this time does not contain time zone information, or the time zone in which he represents depends on & ldquo; human interpretation & rdquo; 2. system Time: this is the time recognized by the software system (here, the OS, it includes the time zone and utc time. 3. rtc time, local, and utc link settings. as mentioned above, rtc time does not contain the time zone.

There are several concepts related to time settings:

1. rtc time/hardware Time: for example, a real-time clock (rtc) hardware device on the motherboard. this time does not contain time zone information, or indicates the time zone, dependent on "manual interpretation"

2. system Time: this is the time recognized by the software system (here, the OS). It contains the time zone and utc time.

3. rtc time, local, and utc relationship settings: As mentioned above, rtc time does not contain time zone information, so let's take most of the utc + 8 zone. It is now eleven o'clock A.M.. if the rtc time is set to, the rtc time obviously corresponds to the local time in the GMT +. if the rtc time is set, it is not hard to see that rtc corresponds to the universal time (that is, the "utc synchronization time ")

The rtc time can still be stored when it is shut down, so it plays a leading role.
The relationship with the rtc time is calculated (assuming it is in the UTC + 8 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

Which one can be set. However, it is noted that the rtc time is regarded as the local time by default in windows, so similar settings can be made in linux for unification. If no windows system exists, you can set

Settings in gentoo include:

1./usr/share/zoneinfo: time zone file related to the time zone

2./etc/localtime and/etc/timezone: Set the time zone.

 

Configuration example:

 

[Root @ localhost ~] # Cp/usr/share/zoneinfo/Asia/Shanghai/etc/localtime

Cp: overwrite '/etc/localtime '? Y

[Root @ localhost ~] #/Usr/sbin/ntpdate time.windows.com

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

[Root @ localhost ~] # Hwclock-w

Note: hwclock-w writes the system clock to the hardware clock.

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.