查看: 50|回覆: 0

[Ubuntu] ubuntu系统下禁用utc时间的设置方法

[複製鏈接]

1

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2008-12-8
發表於 2023-6-17 00:00:00 | 顯示全部樓層 |閲讀模式

前言

大家在安装双系统以后,发现进入win7和ubuntu系统以后,显示的时间不一致,后来发现是两个系统对硬件时间的看法不一致

原因如下

      1、Windows会认为BIOS时间就是你的本地时间

      2、ubuntu默认时间是把BIOS时间当成GMT+0时间,也就是世界标准时,而我国在东八区(GMT+8),所以如果你的Ubuntu位置是中国的话你系统显示的时间就是BIOS时间+8小时。假如现在是早上8点,那么你Ubuntu会显示8点,这时BIOS中的时间是0点。

更正方法

将ubuntu对待bios时间的方法改为和windows一致。

代码:

?
1
sudo timedatectl set-local-rtc 1

代码:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$ timedatectl        
   Local time: 六 2016-04-23 09:05:54 CST
 Universal time: 六 2016-04-23 01:05:54 UTC
    RTC time: 六 2016-04-23 09:05:54
    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'.

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作能带来一定的帮助,如果有疑问大家可以留言交流,谢谢大家对的支持。

原文链接:http://blog.csdn.net/xzknet/article/details/71124979

回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部