In order to learn, in the virtual machine to minimize the installation of CentOS6.7, when used to find the timestamp of the file is inconsistent with the actual time, with date to view the time display:
Friday, January 01, 2016 21:11:43 CST
Then the time displayed with Date-u is correct:
Friday, January 01, 2016 13:12:20 UTC
In order to solve this problem, found some solutions on the Internet, recorded as follows.
World Coordination Time (Universal times COORDINATED,UTC):
If you do not have an NTP server installed, you need to execute the following command first:
Yum-y Install NTP
Synchronization time using the Ntpdate command is as follows:
Ntpdate cn.pool.ntp.org
In the CentOS Linux Terminal command, execute the following command:
1) Vi/etc/sysconfig/clock #编辑时间配置文件
Zone= "Asia/shanghai"
Utc=false #设置为false, hardware clock is not the same as UTC time
Arc=false
2) Ln-sf/usr/share/zoneinfo/asia/shanghai/etc/localtime #linux的时区设置为上海时区
3) ntpdate cn.pool.ntp.org #对准时间
4)/sbin/hwclock--SYSTOHC #设置硬件时间和系统时间一致并校准
After the above steps, our CentOS Linux system time and computer hardware time are finally CST time, and are all in Shanghai time zone.
An inconsistency between UTC time and CST time in Linux