问题
安装Ubuntu20.04后导致Windows10时间改变
解决办法
1.安装 ntpdate
代码如下(示例):
sudo apt-get install ntpdate
2.设置获取时间的服务器
代码如下(示例):
sudo ntpdate time.windows.com
3.将时间更新到主板
代码如下(示例):
sudo hwclock --localtime --systohc
-l
, --localtime
; -u
, --utc
Indicate which timescale the Hardware Clock is set to.
The Hardware Clock may be configured to use either the UTC or the local timescale, but nothing in the clock itself says which alternative is being used. The --localtime or --utc options
give this information to the hwclock command. If you specify the wrong one (or specify neither and take a wrong default), both setting and reading the Hardware Clock will be incorrect.
If you specify neither --utc nor --localtime then the one last given with a set function (--set, --systohc, or --adjust), as recorded in /etc/adjtime, will be used. If the adjtime file
doesn’t exist, the default is UTC.
Note: daylight saving time changes may be inconsistent when the Hardware Clock is kept in local time. See the discussion below, under LOCAL vs UTC.
指示硬件时钟设置为哪个时间刻度。
硬件时钟可以配置为使用UTC或本地时间刻度,但时钟本身没有说明正在使用哪种替代。--localtime
或--utc选项
将此信息提供给hwclock命令。如果您指定了错误的硬件时钟(或者既不指定也不使用错误的默认值),则硬件时钟的设置和读取都将不正确。
如果既不指定--utc
也不指定--localtime
,则将使用最后一个用set函数(–set、–systohc或–adjust)给定的,如/etc/adjtime中所记录的。如果adjtime文件
不存在,默认值为UTC。
注意:当硬件时钟保持在本地时间时,夏令时变化可能不一致。请参阅下面的讨论,在本地与UTC下。
-w
, --systohc
Set the Hardware Clock from the System Clock, and update the timestamps in /etc/adjtime. With the --update-drift option also (re)calculate the drift factor. Try it without the option if --systohc fails. See --update-drift below.
systohc
可分解为sys系统to到h硬件c时钟
从系统时钟设置硬件时钟,并在/etc/adjtime
中更新时间戳。使用--update-drift
选项还(重新)计算漂移因子。如果--systohc
失败,请尝试不使用该选项。
总结
。。。。。。