
问题Local time: Fri 2026-06-26 18:26:50 CST Universal time: Fri 2026-06-26 10:26:50 UTC RTC time: Fri 2026-06-26 18:26:50 Time zone: Asia/Shanghai (CST, 0800) NTP enabled: yes NTP synchronized: no RTC in local TZ: yes DST active: n/a Warning: The system is configured to read the RTC time in the local time zone. This mode can not 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.现在的状态硬件时钟RTC time18:26:50系统本地时间Local time18:26:50 CSTUTC时间10:26:50 UTC问题所在硬件时钟里存的是18:26:50但正确的北京时间应该是10:26:50因为UTC时间10:26:50 8小时 18:26:50 CST。硬件时钟快了8个小时它存的是CST时间18:26:50但系统以为是UTC时间所以显示时又加了8小时导致CST变成了18:26:50。 正确的解决方法既然硬件时钟RTC里存的时间就是错的快了8小时我们需要先把硬件时钟改成正确的时间。步骤1先改回 UTC 模式避免双重转换bashsudo timedatectl set-local-rtc 0步骤2手动设置系统时间为正确的北京时间当前正确的北京时间应该是10:26:50因为UTC显示10:26:50bashsudo date -s 2026-06-26 10:26:50步骤3将正确的系统时间写入硬件时钟UTC格式bashsudo hwclock --systohc --utc步骤4验证bashtimedatectl status date期望输出textLocal time: Fri 2026-06-26 10:26:50 CST ← 正确的北京时间 Universal time: Fri 2026-06-26 02:26:50 UTC ← UTC时间 RTC time: Fri 2026-06-26 02:26:50 ← 硬件时钟存储UTC时间02:26:50 Time zone: Asia/Shanghai (CST, 0800) RTC in local TZ: no ← 保持 no推荐