让Windows 10将BIOS硬件时间视为协调世界时(UTC)的方法:注册表数值名称RealTimeIsUniversal

如果安装了Windows和Linux双系统,可能会遇到切换系统时出现时间错乱问题。具体表现为:使用一段时间Linux后,重启进入Windows,会发现Windows显示的时间不正确;反之亦然。

这是因为BIOS硬件时间本身并没有时区概念,但Windows和Linux对Bios硬件时间与时区关系的理解不一样。Linux将BIOS硬件时间视为协调世界时(UTC),即不存在本地时区;而Windows则将BIOS硬件时间视为当地时间,带上了设置后的时区。Windows这样做,一是早期为了兼容MS-DOS/Windows 3.x,二是为了照顾大众,防止用户问为什么BIOS显示的时间和实际不一致【1】【3】。

那么如何让Windows 10将BIOS硬件时间视为协调世界时(UTC)呢?答案是注册表数值名称RealTimeIsUniversal【2】。

以下列举不同操作注册表的方法,供参考。

方法一:手动操作法

1、以管理员身份打开注册表。

2、定位到“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation”

3、如果没有看到“RealTimeIsUniversal”数值名称,新建一个,类型视操作系统位数而定:如果是64位,则类型为“QWORD”,如果是32位,类型为“DWORD”。

4、编辑“RealTimeIsUniversal”数值名称,将其值改成1。

5、重启。

方法二:注册表文件法

另一种方法则是将如下文本保存为注册表文件RealTimeIsUniversal.reg,然后双击导入,最后重启。

适用于64位Windows:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
"RealTimeIsUniversal"=hex(b):01,00,00,00,00,00,00,00

适用于32位Windows:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
     "RealTimeIsUniversal"=dword:00000001

方法三:命令行法

以管理员身份打开命令行,输入如下命令,然后重启。

注意:以下命令仅适合64位Windows。如果是32位Windows,请把REG_QWORD替换成REG_DWORD。

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

【1】. Raymond Chen,《Why does Windows keep your BIOS clock on local time?》,2004-9-2,https://devblogs.microsoft.com/oldnewthing/20040902-00/?p=37983
【2】. https://wiki.archlinux.org/index.php/System_time#UTC_in_Windows
【3】. Markus Kuhn,《IBM PC Real Time Clock should run in UT》,2001-07-02,https://www.cl.cam.ac.uk/~mgk25/mswish/ut-rtc.html

本页永久链接:https://www.orztip.com/?p=400&article_title=let-windows-recognize-bios-time-as-utc-time-with-realtimeisuniversal