深度UOS时间同步错误问题
Tofloor
poster avatar
dufulin
deepin
2020-09-19 14:38
Author
先说硬件配置:Lenovo 昭阳K 41-70笔记本电脑
在Windows 10 下,主板设置的时间和操作系统显示的时间是一致的。比如,9月12日中午12 时,在Win 10下正常显示为12:00。进入deepinOS 20显示的确是9月12日下午8时(时区设置的是东八区北京上海),然后待会自动同步时间就会改为9月12日中午12时。但是关机后,主板BIOS设置显示时间为9月12日 凌晨4时,进入Windows 10也是凌晨4时。
不知道是主板原因,还是系统错误?
如何修改?
Reply Favorite View the author
All Replies
是大橙子呀
deepin
2020-09-19 17:36
#1
改不了的,这个是老问题了,我主板时间和Deepin的时间一直不一样,就日期 分秒对,小时一直不对
Reply View the author
冷风
deepin
2020-09-19 17:54
#2
本帖最后由 coldwind 于 2020-9-19 09:58 编辑

将 Windows 的时间改成 UTC 时间

  1. Windows Registry Editor Version 5.00

  2. [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation]
  3.      "RealTimeIsUniversal"=qword:00000001
Copy the Code

在 Windows 上新建文本文件放入上面的代码,然后改文件后缀成 reg,之后执行。

Reply View the author
Comments
dufulin
2020-09-24 16:16
谢谢!
lcw0268
deepin
2020-09-19 18:01
#3
也可以改linux系统时间为LTC时间。
Reply View the author
deepinuser17
deepin
2020-09-19 20:03
#4
安装时间同步软件是最有效的解决办法。  时间同步软件可以自动与上游时间服务器比对时间。 如果本地时钟出现偏差, 时间同步软件会自动校对时钟,使时间保持准确。在关机时时间同步软件会更正机器硬件时钟。  

无论系统启动时时钟是否准确,时间同步软件都会逐步校正时钟,直到时钟完全准确为止。

对于网络不稳定,时开时断的机器,时间同步软件chrony是比较好的选择。

安装和使用chrony非常简单。安装以后,时间同步软件chrony自动开始运行,并与公共时间服务器镜像校对时间。

  1. sudo apt install chrony
Copy the Code


查看时间校对状态:
  1. $ chronyc tracking
  2. Reference ID    : 2D370909 (ronin.ruselabs.com)
  3. Stratum         : 3
  4. Ref time (UTC)  : Sat Sep 19 03:48:20 2020
  5. System time     : 0.000215396 seconds fast of NTP time
  6. Last offset     : +0.000106111 seconds
  7. RMS offset      : 0.004006451 seconds
  8. Frequency       : 21.950 ppm fast
  9. Residual freq   : +0.048 ppm
  10. Skew            : 16.566 ppm
  11. Root delay      : 0.027932420 seconds
  12. Root dispersion : 0.001676528 seconds
  13. Update interval : 65.0 seconds
  14. Leap status     : Normal
Copy the Code



查看校对时间所使用的时间服务器:
  1. $ chronyc sources
  2. 210 Number of sources = 4
  3. MS Name/IP address         Stratum Poll Reach LastRx Last sample               
  4. ===============================================================================
  5. ^- eterna.binary.net             2   6   373    64  -4132us[-4443us] +/-   69ms
  6. ^* ronin.ruselabs.com            2   6   377     0    -75us[ -217us] +/-   15ms
  7. ^- ntp1.doctor.com               2   6   377    60  +3863us[+3729us] +/-   87ms
  8. ^- four10.gac.edu                2   6   377     1  +3284us[+3142us] +/-   83ms
Copy the Code


如果要指定校对的时间服务器,编辑/etc/chrony/chrony.conf.
  1. .....
  2. # pool 2.debian.pool.ntp.org iburst
  3. server <本地时间服务器IP地址>
  4. .....
Copy the Code


然后重启chronyd.
  1. sudo systemctl restart chronyd
Copy the Code



Reply View the author
Comments
dufulin
2020-09-24 16:15
谢谢!
SamLukeYes
deepin
2020-09-19 21:21
#5
Reply View the author
dufulin
deepin
2020-09-24 07:31
#6
https://bbs.deepin.org/post/202457
3 楼正解。参考资料:https://wiki.archlinux.org/index.php/System_time_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6 ...

我不知道我是否理解的正确:
Bios硬件显示的时间和Windows一致,而和Linnux不一致。错误不再Linux,而在Windows。
因为硬件的时间不包含时区等其他信息,只存储当前伦敦的时间,即国际时,而不存储地区时。
而Linnux自动将其换算成为本地时。比如,现在,主板时间是伦敦的下午15时,进入Linux后,自动换算成北京时23时。
而Windows读取了主板时间,就认为是本地时,自动同步后认为当前硬件时间错误,强行修改为23时,对于主板来说,应该是伦敦的23时。进入Linux后,Linux认为伦敦现在23时了,就应该是北京第二天7时。于是又给调整为伦敦的15时,北京的23时了。
Reply View the author
SamLukeYes
deepin
2020-09-24 07:38
#7
https://bbs.deepin.org/post/202457
我不知道我是否理解的正确:
Bios硬件显示的时间和Windows一致,而和Linnux不一致。错误不再Linux,而在W ...

对的,就 Windows 搞特殊,默认把主板时间识别为本地时间。类 Unix 的全都默认主板时间为 UTC。
Reply View the author
dufulin
deepin
2020-09-24 16:15
#8
https://bbs.deepin.org/post/202457
对的,就 Windows 搞特殊,默认把主板时间识别为本地时间。类 Unix 的全都默认主板时间为 UTC。 ...

已按照3楼的方法,将Windows读取的硬件时间理解为标准时。Windows已经能够和类Unix一样了。
另外纠正参考资料中的一句话:
Windows 使用 UTC 后,请记得禁用 Windows 的时间同步功能,以防 Windows 错误设置硬件时间。
在64位Windows 10中,可以放心的打开时间同步。不会再恢复主板为本地时了。
谢谢!
Reply View the author
SamLukeYes
deepin
2020-09-24 17:06
#9
https://bbs.deepin.org/post/202457
已按照3楼的方法,将Windows读取的硬件时间理解为标准时。Windows已经能够和类Unix一样了。
另外纠正参考 ...

中文翻译是 16 年的了,英文原版里面好像没提到这个
Reply View the author