Last update at :2024-03-23,Edit by888u
A few days ago, when using a script on this website, I found that a script reported a timestamp is error error. Later, I found that the system time had errors due to a long period of non-synchronization. This article will share how to check the time zone and synchronize the network time on CentOS. System version for CentOS 6 and CentOS 7.
1. Tutorial on checking time zone on CentOS
The CentOS time zone viewing command is as follows:
date -RThe returned results are as follows:
The +0800 behind it means East Eighth District (Beijing time).
2. CentOS network time synchronization tutorial
System time is still very important. If there is an error, some functions may not be available, especially scripts that check the system time.
A common method is to synchronize time through the ntpdate command. The command is as follows:
#Install ntpdate yum -y install ntpdate #synchronised time ntpdate -u pool.ntp.orgAfter synchronization is completed, you can use the date command to check whether the time is correct:
Recommended site search: dynamic dial-up vps host, Guangzhou host rental, expired registered domain name, special price space, com domain name registration, foreign php space, purchase domain name and space, retrieval of registered password, cheapest cloud server, France Proxy server,
发表评论