新安装ubuntu系统可能不是东八区
查看当前时区 timedatectl
root@xxx:~# timedatectl
Local time: Sun 2026-07-19 15:16:02 CST
Universal time: Sun 2026-07-19 07:16:02 UTC
RTC time: Sun 2026-07-19 07:16:02
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
首先将硬件时钟设为标准的 UTC 模式(消除报错警告)
sudo timedatectl set-local-rtc 0
然后设置本地时区为东八区
sudo timedatectl set-timezone Asia/Shanghai
然后查看
timedatectl