Linux和Windows双系统,系统时间问题的困惑?
Tofloor
poster avatar
hdmi
deepin
2020-09-05 02:44
Author
Linux和Windows双系统,系统时间问题的困惑?


每次切换后系统时间都是错误的,比如现在是18:42




系统时间是10:42
Reply Favorite View the author
All Replies
avatar
忘记、过去
deepin
2020-09-05 03:20
#1
修改windows注册表,把主板时间识别为UTC时间。

具体方法百度windows和linux时间同步即可。(windows和黑苹果时间同步也行)
Reply View the author
avatar
杨海瑞
deepin
2020-09-05 04:06
#2
困扰很长时间了
Reply View the author
avatar
SamLukeYes
deepin
2020-09-05 04:10
#3
Reply View the author
avatar
mcaoser
deepin
2020-09-05 04:16
#4
本帖最后由 mcaoser 于 2020-9-4 20:18 编辑

先在deepin中将时间校准 ,然后,


sudo timedatectl set-local-rtc 1

这个命令在其他的linux里是直接能达到目的的,但deepin却有时不行,需要先sudo timedatectl set-local-rtc 0,然后再sudo timedatectl set-local-rtc 1,且有时还得多试几次,只有当用timedatectl看到如下内容中第四行的RTC time与第二行Local time的时间相同时才表示成功了:

$ timedatectl
               Local time: 五 2020-09-04 20:13:16 CST
           Universal time: 五 2020-09-04 12:13:16 UTC
                 RTC time: 五 2020-09-04 20:13:16   
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes                       
              NTP service: active                    
          RTC in local TZ: yes                       

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'.
Reply View the author
avatar
Feng Yu
deepin
2020-09-05 04:26
#5
Linux默认UTC时间,而Windows默认BIOS主板时间,因此会差8小时。解决方案二选一,Windows可以改注册表,改为UTC时间,也可以Linux下改为BIOS时间。就是楼上的方案
Reply View the author
avatar
deepinuser17
deepin
2020-09-05 07:16
#6
最根本的解决方法是通过时间同步软件来自动调整时间到正确时间.Linux上最常用的时间同步软件有ntp, chrony. Chrony是最近开始流行的时间同步软件.

时间同步软件可以不间断地与上游时间服务器(公开,共享)同步,修正系统时间的偏差,保证系统时间的准确.在关机,重启时,时间同步软件还能自动修正机器硬件BIOS的时钟.即使BIOS时间无法持续保持准确(因为主板电池问题), 时间同步软件也能让系统时间时刻保持准确.

https://www.cnblogs.com/jhxxb/p/11526098.html
https://www.cnblogs.com/williamjie/p/10768657.html
Reply View the author
avatar
hdmi
deepin
2020-09-05 16:39
#7
https://bbs.deepin.org/post/201364
先在deepin中将时间校准 ,然后,

嗯 这个办法管用
Reply View the author
avatar
SamLukeYes
deepin
2020-09-05 18:17
#8
https://bbs.deepin.org/post/201364
最根本的解决方法是通过时间同步软件来自动调整时间到正确时间.Linux上最常用的时间同步软件有ntp, chrony ...

这不是根本的解决方案,只能算一个 workaround,等于每次启动不同的系统时都要改一次硬件时间,在 UTC 和 localtime 之间反复横跳
Reply View the author
avatar
deepinuser17
deepin
2020-09-05 18:42
#9
本帖最后由 deepinuser17 于 2020-9-5 10:44 编辑
https://bbs.deepin.org/post/201364
这不是根本的解决方案,只能算一个 workaround,等于每次启动不同的系统时都要改一次硬件时间,在 UTC 和  ...

如果机器能自动,有效地解决问题,就不要手动去解决.一个用户不可能随时随地的去监控机器,系统时间,去调整时间.即使启动时手动调整了时间,机器在运行程中时钟依然会发生漂移.在自动对时方面,人不可能比机器做得更好.机器是用来为人服务的,而不是让人来为机器服务.设置了时间同步以后,就不需要进行任何手动调节时间了.
Reply View the author
Comments
mcaoser
2020-09-06 18:06
没有网络时怎么办呢
avatar
SamLukeYes
deepin
2020-09-05 18:46
#10
https://bbs.deepin.org/post/201364
如果机器能自动,有效地解决问题,就不要手动去解决.一个用户不可能随时随地的去监控机器,系统时间,去 ...

小幅度的校正没问题,反复横跳容易出问题
Reply View the author
avatar
gangzai0707
deepin
2020-09-05 18:58
#11
deepin15.11设置自动更新时间,会比北京时间快两分半,这个怎么解决,V20里开启自动更新时间后,切换到别的界面,再点回来,显示自动更新还是关闭的
Reply View the author