跳转至

双系统时间不一致

原因

Linux 默认将硬件时间理解为 UTC 时间,而 Windows 则理解为是本地时间.

解决方案

  • Windows 使用 UTC

    reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1
    

    然后重启系统.

  • Linux 使用本地时间

    # 方法 1 (待验证)
    timedatectl set-local-rtc 1 --adjust-system-clock # 使用 localtime
    sudo timedatectl                                  # 验证时间
    
    # 方法 2 (待验证)
    sudo timedatectl set-local-rtc 1
    sudo hwclock --localtime --systohc
    

评论