【解决办法】
(1)首先,bios硬件时间的时区一定要设置成UTC时区,不能设置成UTC+8时区。
如果bios硬件时间没有设置成标准的UTC时区的话,执行timedatectl命令会看到醒目的黄色警告。
oct1158@fedora:~/Documents$ timedatectl
Local time: Tue 2026-01-06 16:11:03 CST
Universal time: Tue 2026-01-06 08:11:03 UTC
RTC time: Tue 2026-01-06 16:11:03
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: yes
Warning: The system is configured to read the RTC time in the local time zone.
This mode cannot be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
'timedatectl set-local-rtc 0'.
此时需要执行sudo timedatectl set-local-rtc 0命令,将bios硬件时间的时区设置成UTC时区。
oct1158@fedora:~/Documents$ sudo timedatectl set-local-rtc 0
[sudo] password for oct1158:
这样再次执行timedatectl命令,黄色警告就消失了。
oct1158@fedora:~/Documents$ timedatectl
Local time: Tue 2026-01-06 16:11:49 CST
Universal time: Tue 2026-01-06 08:11:49 UTC
RTC time: Tue 2026-01-06 08:11:49
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
oct1158@fedora:~/Documents$
