In linux, the time difference is 8 hours.

Source: Internet
Author: User
In linux, the time difference is 8 hours. For more information, see Debian, the Linux release technology. Time is money ..... Can be 8 hours: 0 (1 .... It has been suffering for a while .... Know how to solve this problem
Now it is basically to solve the problem... Share with you

The Time Zone configuration involves two files:
/Etc/localtime
/Etc/timezone

The timezone file is a text file, which only needs to write a line of its own time zone. Here we are Shanghai (Asia/Shanghai)

The type of the localtime file is unclear, and some timezone data is written in it, which can be copied from the system's built-in Time Zone file at:/usr/share/zoneinfo
You can find the localtime copied from the Shanghai directory to the/etc directory. You can also create a join, which also works.

Set the time zone and determine the Linux time scheme. Linux supports UTC Time, Coordinated Universal Time, that is, the Time on the local meridian, And the GMT) the difference seems to be that it is averaged by multiple atomic clocks. In the/etc/default/rcS file, whether or not the system uses UTC is set, and UTC = yes is used.

The computer has its own time, that is, the hardware time, hard clock, that is, the time in the BIOS, And the shutdown will not be lost. This time will be read when the computer starts. If the time is set to UTC (GMT), that is, the time in London, it is required to Set UTC = yes in the rcS file, and vice versa.

In short, there are two correct settings:
BIOS = local time, UTC = no
BIOS = UTC time, UTC = yes

Generally, the BIOS is set to the local time. This is because if a dual system is installed, Windows does not seem to understand UTC, and the problem may occur. At this time, UTC = no.


The hwclock command is used to read the hardware in Linux:
Hwclock -- show: displays the hardware time.
Hwclock -- systohc: Write System Time to hardware
Hwclock -- hctosys: Write hardware time to system time
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.