双系统时差问题
Linux 默认把 RTC 时间当作 UTC 时间,而 Windows 默认把 RTC 时间当作本地时间。
因此解决办法就是把 Linux 的 RTC 时间设为本地时间,或者把 Windows 的 RTC 时间设为 UTC 时间。
把 Linux 的 RTC 时间设为本地时间的命令为:
timedatectl set-local-rtc 1
这么做会产生一个警告:
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'.
把 Windows 的 RTC 时间设为 UTC 时间的命令为:
Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1