How to make UTC in a Linux system consistent with CST

Source: Internet
Author: User
Tags cst time local time



First, the basic concept



UTC is the Universal time coordinated abbreviation, which is defined and recommended by the International Radio Advisory Committee and is maintained by the International Time Bureau (BIH) in seconds-based time scales.
UTC is equivalent to the average sun on the Prime meridian (that is, longitude 0 degrees), which was previously expressed in Greenwich Mean Time (GMT).
GMT (Greenwich Mean time) is Greenwich mean when-astronomers use, ITPro to find out.



Coordinated World time (English: Coordinated Universal time, Law: Temps universel coordonné), also known as the world's Unification times, world standard Time, international coordination time. Abbreviations in English (CUT) and French (TUC) are not



With, as a compromise, referred to as UTC.



Beijing time is 8 hours earlier than UTC time, taking January 1, 1999 0000UTC as an example, UTC time is 0 points, Beijing time is January 1, 1999 8 o'clock in the morning the whole. So we were 8 hours apart on time.
At this time the BIOS time and the system time are of course inconsistent, one represents UTC time, and one represents the cst+8 time zone), that is, Shanghai.






In Linux, when viewing time with date:
Tue Sep 15:52:10 CST 2015.



World Coordination Time (Universal times COORDINATED,UTC):
Tue Sep 07:52:10 UTC 2015.



There are two kinds of time difference in GPS system, one is UTC, the other is LT (local time) is different from time zone, UTC is the time of 0 time zone, local time, such as Beijing for eight A.M. (East eight), UTC time Is



0 o'clock, the time is eight hours later than in Beijing, the calculation can be.



According to my personal understanding:
CST should refer to (China Shanghai TIME,CST East Eight time)--Personal understanding
UTC should mean (Universal time COORDINATED,UTC Standard)
Local time is now:tue Sep 15:52:10 CST 2015.
Universal time is now:tue Sep 07:52:10 UTC 2015.
These 2 times should actually be 8 hours apart.



Why? UTC is inconsistent with CST



After the initial installation of the CentOS Linux operating system, the time to click on the system is not consistent with the current time, the difference is 8 hours, although in the installation of the system, we choose the time zone is Shanghai



Zone= "Asia/shanghai", but the default BIOS time for CentOS Linux is UTC time




Second, how to make UTC consistent with CST






Domestic available NTP Server:
cn.pool.ntp.org
tw.pool.ntp.org


ping cn.pool.ntp.org -t
Pinging cn.pool.ntp.org [202.112.10.36] with 32 bytes of data:
Reply from 202.112.10.36: bytes=32 time=110ms TTL=46
Reply from 202.112.10.36: bytes=32 time=109ms TTL=46
Reply from 202.112.10.36: bytes=32 time=109ms TTL=46
......
ping tw.pool.ntp.org -t
Pinging tw.pool.ntp.org [120.119.28.1] with 32 bytes of data:
Reply from 120.119.28.1: bytes=32 time=48ms TTL=51
Reply from 120.119.28.1: bytes=32 time=48ms TTL=51
Reply from 120.119.28.1: bytes=32 time=49ms TTL=51
......


If you do not have an NTP server installed, you just need to execute the following command first:



Yum Install NTP



Synchronization time using the Ntpdate command is as follows:



Ntpdate cn.pool.ntp.org






Editing the time configuration file
1) #VI / etc / sysconfig / clock edit time profile
Zone= "Asia/shanghai"
UTC = false, hardware clock is not the same as UTC time
Arc=false


# diff /etc/sysconfig/clock  /etc/sysconfig/clock.bak

2,4d1

< UTC=false

< ARC=false

<






Under Linux, you can also set the current system time zone step by run by running the command Tzselect and then entering the number in front of the option.


[[email protected] home]$ 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.

#? 5






2) #ntpdate cn.pool.ntp.org #Alignment time


ntpdate cn.pool.ntp.org

16 Sep 09:31:01 ntpdate[22530]: step time server 202.112.31.197 offset 61936.560266 sec


After the above steps, our CentOS Linux system time and computer hardware time are finally CST time, and are all in Shanghai time zone.






3) #hwclock--SYSTOHC #Set hardware time to be consistent with system time and calibrate



After the above steps, our CentOS Linux system time and computer hardware time are finally CST time, and are all in Shanghai time zone.







Small knowledge:



mon. (Monday)     Tue. ( Tuesday)    Wed. (Wednesday)    Thu. (Thursday)   Fri (Friday)    Sat. (Saturday)    Sun. (Sunday)
Mon Monday            Tue Tuesday           Wed Wednesday                  thu Thursday            Fri Friday       Sat Saturday             sun Sunday



jan. (January)    Feb. (February)   Mar. (March)         APR. (April)      May. (May)        June (June)  
Jan January           Feb February         April March             Apr April          may May           June June
 
Jul (July)       (August)     Sep. ( September)    Oct. (October)    Nov (November)    Dec (December)  
Jul July           August          sep/sept September       Oct October          Nov November          Dec December














This article is from the "Ab_linuxer Learning Vegetable Garden" blog, please be sure to keep this source http://ablinuxer.blog.51cto.com/4750670/1695783



How to make UTC in a Linux system consistent with CST


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.