第一种,时间为2019年
timedatectl status
Local time: Mon 2022-12-12 23:35:24 CST
Universal time: Mon 2019-12-12 15:35:24 UTC
RTC time: Mon 2019-12-12 15:35:28
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
NTP service: n/a
RTC in local TZ: no
Local time: Mon 2022-12-12 23:35:24 CST
Universal time: Mon 2019-12-12 15:35:24 UTC
RTC time: Mon 2019-12-12 15:35:28
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: no
NTP service: active
RTC in local TZ: no
解决办法
vi /etc/systemd/timesyncd.conf
#添加
NTP=ntp.ntsc.ac.cn cn.ntp.org.cn
sudo timedatectl set-ntp on
timedatectl status
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
第二种时区问题
timedatectl set-timezone Asia/Shanghai