CentOS 7.x system time slows down by 12 hours after installation

After installing CentOS 7.x, I found that the system time is exactly 12 hours behind Beijing time, which is because the default time zone is wrong. Check the system time and find that the time zone is EDT (Eastern Daylight Time), as follows:

# date
Sat Apr 22 00:52:30 EDT 2023

The time zone needs to be changed to CST (China Standard Time), the steps are as follows.

The first step is to back up the original configuration file

# mv /etc/localtime /etc/localtime.bak

The second step is to create a soft connection

# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

The third step, test confirmation

# date
Sat Apr 22 13:03:25 CST 2023

You can see that the time has returned to normal. Looking at the configuration file, you can see that the original configuration soft link is the configuration of New York.

Attachment: If the system time is still different from Beijing time after the above steps, you can use ntpdate to synchronize the system time. For details, see " Setting the Operating System Time to Synchronize with the Internet Server_Meng Langlang's Blog-CSDN Blog ".

Guess you like

Origin blog.csdn.net/tzhuwb/article/details/130303498
Recommended