linux time zone issue

linux time zone issue

1. In linux, when the viewing time with date display:

  February 17, 2013 19:04:14 CST Wednesday 

Coordinated Universal Time (Universal Time Coordinated, UTC):

  There are two GPS system time distinction, one for UTC, the other is LT (local time) difference between the two different time zone, UTC is the time zone of 0:00, local time to local time, as Beijing was eight in the morning (east eight districts), UTC time is zero, the time when Beijing later than eight hours this calculation can be.

Under Linux by running the command tzselect then enter the numbers in front of the options step by step to set the current system time zone.

If there is no ntp server installation, just need to execute the following command:

    yum install ntp

Ntpdate time synchronization using the following command:

  ntpdate cn.pool.ntp.org

2. After we finished installing Centos Linux operating system, click on the system time found inconsistent with the time used today, a difference is 8 hours, and in the installation of the system we choose the time zone in Shanghai, but CentOS Linux default bios time is utc time (UTC is coordinated Universal time (Universal time coordinated) abbreviation, and is recommended by the provisions of the international radio Consultative Committee by the international time Bureau (BIH) is responsible for keeping the time scale of seconds .UTC-based equivalent mean solar time on the prime meridian (0 degrees longitude that is), the average time was past Greenwich (GMT) to represent. Beijing time 8 hours earlier than UTC to 1999 January 1 0000UTC for example, UTC time is 0:00, Beijing time for the January 1, 1999 8:00 o'clock.), so we are in a time above 8 hours apart. This time time time and bios of the system, of course, is inconsistent, a representative of utc time, a representative of cst (+8 time zone), namely Shanghai time.

CentOS Linux execute the following command in the Terminal command:

1) .vi / etc / sysconfig / clock # Editing Time Profile

    ZONE="Asia/Shanghai"

    UTC = false # set to false, the hardware clock is not consistent at the time utc

    ARC=false

2) .ln -sf / usr / share / zoneinfo / Asia / Shanghai / etc / localtime #linux time zone is set to Shanghai area

3) .ntpdate cn.pool.ntp.org   # alignment time   

4) ./ sbin / hwclock --systohc # set the hardware and system time consistent and calibrated

After the above steps, our CentOS linux system time and computer hardware is finally time cst time, and all time zones Shanghai.

Transfer: https://blog.csdn.net/wangmj518/article/details/49683305

Guess you like

Origin www.cnblogs.com/longchengruoxi/p/11113319.html
Recommended