#修改 Windows對硬件時間的對待方式,讓 Windows把硬件時間當作UTC
Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1
Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1
UTC即Universal Time Coordinated,協調世界時
GMT即Greenwich Mean Time,格林尼治平時
Windows 與 Linux 缺省看待系統硬件時間的方式是不一樣的:(caused by)
* Windows把系統硬件時間當作本地時間(local time),即操作系統中顯示的時間跟BIOS中顯示的時間是一樣的。
* Linux/Unix/Mac把硬件時間當作 UTC,操作系統中顯示的時間是硬件時間經過換算得來的,比如說北京時間是GMT+8,則系統中顯示時間是硬件時間+8.
Windows解決方案
Win+R進入cmd,以管理員身份運行后在命令行中輸入下面命令並回車
Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_DWORD /d 1
Linux解決方案
打開terminal,編輯/etc/default/rcS文件
sudo vi /etc/default/rcS
找到這一行
UTC=yes
把yes改為no,保存並退出
如果說找不到UTC = yes 直接在terminal運行(本人親測Ubuntu16.04)
sudo timedatectl set-local-rtc 1
