ICode9

精准搜索请尝试: 精确搜索
首页 > 系统相关> 文章详细

解决Windows10与Ubuntu16.04双系统时间不一样问题

2020-05-14 19:07:47  阅读:298  来源: 互联网

标签:Ubuntu16.04 RTC 双系统 Windows Ubuntu Windows10 时间 time local


目录

原因分析

Ubuntu默认是用硬件时间(RTC, real time clock),加上UTC(universal time)时区得到显示的时间。
而Windows则默认用本地时间(local time),这导致Windows和Ubuntu双系统的时间显示不一致。

具体表现:在Windows上通过关掉-开启网络同步时区,正确的显示了时间;重启进Ubuntu,时间显示也正确;但再次回到Win10发现时间少了8小时。

解决办法

方法1:改Ubuntu时间显示方式

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

验证:

timedatectl
(base) 1080Ti% timedatectl
      Local time: 四 2020-05-14 18:52:11 CST
  Universal time: 四 2020-05-14 10:52:11 UTC
        RTC time: 四 2020-05-14 18:52:12
       Time zone: Asia/Shanghai (CST, +0800)
 Network time on: yes
NTP synchronized: no
 RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not 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,调整到正确时间。以后再进入Ubuntu或Windows都显示正确了。

方法2:改Windows注册表

不推荐这种方式,不过你如果坚持要用,也不妨一试:

管理员方式打开cmd,执行如下命令:

64位系统(目前绝大多数都是64位win10):

Reg add HKLM\SYSTEM\CurrentControlSet\Control\TimeZoneInformation /v RealTimeIsUniversal /t REG_QWORD /d 1

32位系统(如果你的电脑情况特殊,用了32位win10,此类情况很少见):

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

然后,关掉“网络更新”的时间选项,并且重启系统。

参考

标签:Ubuntu16.04,RTC,双系统,Windows,Ubuntu,Windows10,时间,time,local
来源: https://www.cnblogs.com/zjutzz/p/12890740.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有