方案一:让 Ubuntu 使用本地时间(推荐,一步到位)

命令:

sudo timedatectl set-local-rtc 1 --adjust-system-clock

验证命令:

timedatectl status

返回RTC in local TZ: yes即成功

cyrus@cyrus-tuf:~$ sudo timedatectl set-local-rtc 1 --adjust-system-clock
cyrus@cyrus-tuf:~$ timedatectl status
               Local time: 三 2026-05-06 11:03:23 CST
           Universal time: 三 2026-05-06 03:03:23 UTC
                 RTC time: 三 2026-05-06 03:03:23
                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 apt update
sudo apt install -y ntpdate util-linux-extra
sudo ntpdate ntp.aliyun.com
sudo hwclock --localtime --systohc

方案二:让 Windows 使用 UTC 时间(适合习惯 Linux UTC 的用户)
以管理员身份打开 Windows 命令提示符(CMD),执行:

reg add "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TimeZoneInformation" /v RealTimeIsUniversal /t REG_DWORD /d 1 /f

或手动改注册表:

  1. Win+R → regedit

  2. 定位:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation

  3. 新建 DWORD (32 位) 值,命名:RealTimeIsUniversal,值:1,基数:十六进制。重启电脑,进入 Ubuntu 联网同步一次时间即可。

关键说明

  • 不要同时用两种方案,选其一即可。

  • 每次切换系统后,联网同步一次时间更稳

  • 偏差固定为8 小时就是此问题;若为其他偏差,先检查时区设置是否正确。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。