当前位置: 技术问答>linux和unix
使用u盘ubuntu之后,原来windows系统的时间变了?
来源: 互联网 发布时间:2017-05-10
本文导语: 我在u盘里面做了个ubuntu系统,每次使用了ubuntu之后,重启回到windows 7,win7的时间总是变慢好几个小时。如目前的时间是10:00,重启登录u盘的ubuntu之后,再切回到win7,时间变成了1:00。请问这怎么回事啊? ...
我在u盘里面做了个ubuntu系统,每次使用了ubuntu之后,重启回到windows 7,win7的时间总是变慢好几个小时。如目前的时间是10:00,重启登录u盘的ubuntu之后,再切回到win7,时间变成了1:00。请问这怎么回事啊?
|
这是你u盘系统中配置文件有问题,编辑文件 /etc/default/rcS,
找到UTC=yes,修改成UTC=no
保存文件,在系统->系统管理->日期和时间中,设置为正确的日期和时间,在命令行输入下面的命令重启时间: sudo /etc/init.d/hwclock.sh restart
我只能帮你到这了。
找到UTC=yes,修改成UTC=no
保存文件,在系统->系统管理->日期和时间中,设置为正确的日期和时间,在命令行输入下面的命令重启时间: sudo /etc/init.d/hwclock.sh restart
我只能帮你到这了。
|
run this command in ubuntu:
sudo hwclock -w --localtime
sudo hwclock -w --localtime
|
Multiple Boot Systems Time Conflicts
Operating systems store and retrieve the time in the hardware clock located on your motherboard so that it can keep track of the time even when the system does not have power. Most operating systems (Linux/Unix/Mac) store the time on the hardware clock as UTC by default, though some systems (notably Microsoft Windows) store the time on the hardware clock as the 'local' time. This causes problems in a dual boot system if both systems view the hardware clock differently.
The advantage of having the hardware clock as UTC is that you don't need to change the hardware clock when moving between timezones or when Daylight Savings Time (DST) begins or ends as UTC does not have DST or timezone offsets.
Changing Linux to use local time is easier and more reliable than changing Windows to use UTC, so dual-boot Linux/Windows systems tend to use local time.
Since Intrepid (8.10), UTC=yes is default.
Make Windows use UTC
Note: This method was not initially supported on Windows Vista and Server 2008, but came back with Vista SP2, Windows 7 and Server 2008 R2.
To make MS Windows calculate the time from the hardware clock as UTC.
Create a file named WindowsTimeFixUTC.reg with the following contents and then double click on it to merge the contents with the registry:
Reversing the change
You can create a file with the following contents and then double-click it to merge in the original changes, as above:
or you can enter Registry Editor with
and navigate down to:
and delete RealTimeIsUniversal by right-clicking it and deleting it.
Make Linux use 'Local' time
To tell your Ubuntu system that the hardware clock is set to 'local' time:
edit /etc/default/rcS
add or change the following section
Operating systems store and retrieve the time in the hardware clock located on your motherboard so that it can keep track of the time even when the system does not have power. Most operating systems (Linux/Unix/Mac) store the time on the hardware clock as UTC by default, though some systems (notably Microsoft Windows) store the time on the hardware clock as the 'local' time. This causes problems in a dual boot system if both systems view the hardware clock differently.
The advantage of having the hardware clock as UTC is that you don't need to change the hardware clock when moving between timezones or when Daylight Savings Time (DST) begins or ends as UTC does not have DST or timezone offsets.
Changing Linux to use local time is easier and more reliable than changing Windows to use UTC, so dual-boot Linux/Windows systems tend to use local time.
Since Intrepid (8.10), UTC=yes is default.
Make Windows use UTC
Note: This method was not initially supported on Windows Vista and Server 2008, but came back with Vista SP2, Windows 7 and Server 2008 R2.
To make MS Windows calculate the time from the hardware clock as UTC.
Create a file named WindowsTimeFixUTC.reg with the following contents and then double click on it to merge the contents with the registry:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation]
"RealTimeIsUniversal"=dword:00000001
Reversing the change
You can create a file with the following contents and then double-click it to merge in the original changes, as above:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation]
"RealTimeIsUniversal"=dword:00000000
or you can enter Registry Editor with
regedit
and navigate down to:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTimeZoneInformation
and delete RealTimeIsUniversal by right-clicking it and deleting it.
Make Linux use 'Local' time
To tell your Ubuntu system that the hardware clock is set to 'local' time:
edit /etc/default/rcS
add or change the following section
# Set UTC=yes if your hardware clock is set to UTC (GMT)
UTC=no