After installing the CentOS Linux operating system, the time we clicked on the system was found to be inconsistent with the time we used now, which is 8 hours, while the time zone we chose when we installed the system was Shanghai, but CentOS linux default http://www.aliyun.com The/zixun/aggregation/19247.html ">bios time is UTC time (UTC is the coordinated World (Universal time coordinated) abbreviation, which is stipulated and recommended by the International Radio Advisory Board and is provided by the International Time Bureau ( BIH) is responsible for maintaining the time scale based on seconds. UTC, which corresponds to the average sun on the meridian (i.e. longitude 0 degrees), was previously represented by Greenwich Mean Time (GMT). Beijing time is 8 hours earlier than UTC, with January 1, 1999 0000UTC as an example, UTC time is 0, Beijing time is January 1, 1999 8 o'clock in the morning whole. So we're 8 hours apart. This time the BIOS time and system time of course is inconsistent, one represents UTC time, one represents CST (+8 time zone), that is, Shanghai time.
Let's start synchronizing the operating system's time!
Execute the following command in the CentOS Linux Terminal command:
1, Vi/etc/sysconfig/clock #编辑时间配置文件
Zone= "Asia/shanghai"
Utc=false #设置为false, hardware clock is not consistent with UTC time
Arc=false
2, Ln-sf/usr/share/zoneinfo/asia/shanghai/etc/localtime #linux的时区设置为上海时区
3, Ntpdate 192.43.244.18 #对准时间
If you do not have an NTP server installed, you just need to execute the following command:
Yum Install NTP #安装ntp服务器
4,/sbin/hwclock--SYSTOHC #设置硬件时间和系统时间一致并校准
Well, our CentOS Linux system time and computer hardware time are finally CST time, and are the Shanghai time zone, finally is normal.