時間對于任何系統至關重要,無論Linux系統,Windows系統,網絡設備等。
## 日期時間
查詢日期時間
```
timedatectl
```
查詢時區
```
timedatectl list-timezones
timedatectl list-timezones | grep -i asia
timedatectl list-timezones | grep -i shanghai
```
設置時區
```
timedatectl set-timezone Asia/Shanghai
```
## 時間服務
查詢chrony
```
yum info chrony
```
安裝和配置chrony服務
```
yum install chrony -y
systemctl start chronyd
systemctl enable chronyd
systemctl status chronyd
```
配置文件/etc/chrony.conf
```
# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
省略...
```