在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

ubuntu系统怎么修改时区和时间

133次阅读
没有评论

共计 3030 个字符,预计需要花费 8 分钟才能阅读完成。

本文丸趣 TV 小编为大家详细介绍“ubuntu 系统怎么修改时区和时间”,内容详细,步骤清晰,细节处理妥当,希望这篇“ubuntu 系统怎么修改时区和时间”文章能帮助大家解决疑惑,下面跟着丸趣 TV 小编的思路慢慢深入,一起来学习新知识吧。

在 linux 计算机上,有两个时间,一个是硬件时间(bios 中记录的时间,称为 hwclock),另一个是操作系统时间(osclock)。硬件时钟由 bios 电池供电,

当计算机关机后,会继续运行,bios 电池一般可使用几年,如果没电了,那 bios 中的数据会恢复出厂设置。

硬件时间与操作系统时间的交互流程

1、开机时,操作系统从 bios 中读取硬件时间 + 时区,然后根据 osclock 的时区,转换为对应的时间。然后操作系统时间与硬件时间就独立运行,相互不影响,我们

通过应用程序获取的时间用的都是操作系统时间。这一步是开机时 os 自动完成的。

2、主机运行过程中,通过 ntp 保证 osclock 与国际原子时同步,再将 osclock 同步到 hwclock。这一步需要自己配置实现

3、关机时,osclock 写入 hwclock。这一步是关机时 os 自动完成的。不过我们要考虑异常关机的情况,当异常关机时,osclock 可能没有写入 hwclock,这就是为什

么在第 2 步中将 osclock 定时刷入 hwclock 的原因。如果不定时刷入,那 osclock 与 hwclock 差距比较大时,若异常关机,osclock 就丢掉了,再开机时,osclock 就是

错误的,在第一个 ntp 同步到来时,osclock 就一直是错误的。而且如果使用的是 ntpd,ntpd 是渐进调整,要经过多个 ntp 同步周期后才会将 osclock 调整为国际原子

时,另外,如果 osclock 与 ntp server 的时间差超过 1000 秒,那 ntp server 就不会更新 osclock 了。

ubuntu 修改时区和时间的方法

1. 首先查看时区:

codetc@webubuntu:~$ date -r
tue, 17 dec 2013 18:23:01 +0800

如果要修改时区,执行 sudo tzselect

2. 选择区域:亚洲

codetc@webubuntu:~$ sudo tzselect
[sudo] password for codetc: 
please identify a location so that time zone rules can be set correctly.
please select a continent or ocean.
 1) africa
 2) americas
 3) antarctica
 4) arctic ocean
 5) asia
 6) atlantic ocean
 7) australia
 8) europe
 9) indian ocean
10) pacific ocean
11) none - i want to specify the time zone using the posix tz format.
#? 5

3. 选择国家:中国

please select a country.
 1) afghanistan 18) israel 35) palestine
 2) armenia 19) japan 36) philippines
 3) azerbaijan 20) jordan 37) qatar
 4) bahrain 21) kazakhstan 38) russia
 5) bangladesh 22) korea (north) 39) saudi arabia
 6) bhutan 23) korea (south) 40) singapore
 7) brunei 24) kuwait 41) sri lanka
 8) cambodia 25) kyrgyzstan 42) syria
 9) china 26) laos 43) taiwan
10) cyprus 27) lebanon 44) tajikistan
11) east timor 28) macau 45) thailand
12) georgia 29) malaysia 46) turkmenistan
13) hong kong 30) mongolia 47) united arab emirates
14) india 31) myanmar (burma) 48) uzbekistan
15) indonesia 32) nepal 49) vietnam
16) iran 33) oman 50) yemen
17) iraq 34) pakistan
#? 9

4. 选择时区:北京时间

please select one of the following time zone regions.
1) east china - beijing, guangdong, shanghai, etc.
2) heilongjiang (except mohe), jilin
3) central china - sichuan, yunnan, guangxi, shaanxi, guizhou, etc.
4) most of tibet   xinjiang
5) west tibet   xinjiang
#? 1

5. 确认验证:

the following information has been given:
 china
 east china - beijing, guangdong, shanghai, etc.
therefore tz= asia/shanghai  will be used.
local time is now: tue dec 17 18:22:10 cst 2013.
universal time is now: tue dec 17 10:22:10 utc 2013.
is the above information ok?
1) yes
2) no
#? 1
you can make this change permanent for yourself by appending the line
 tz= asia/shanghai  export tz
to the file  .profile  in your home directory; then log out and log in again.
here is that tz value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
asia/shanghai

6. 复制文件到 /etc 目录下

sudo cp /usr/share/zoneinfo/asia/shanghai /etc/localtime

7. 更新时间

sudo ntpdate time.windows.com

8. 修改时间以后,修改硬件 cmos 的时间

sudo hwclock --systohc

读到这里,这篇“ubuntu 系统怎么修改时区和时间”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注丸趣 TV 行业资讯频道。

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-15发表,共计3030字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 永久在线免费 | 欧美高清videos性极品 | 亚洲愉拍二区一区三区 | 男人扒开女人双腿猛进视频 | 在线观看人乳授乳奶水榨 | 国产精品亚洲专区一区 | 久久亚 | 亚洲av无码专区亚洲av | 免费观看a级毛片 | 日韩一级在线观看 | 国产成人在线播放视频 | 免费黄色毛片视频 | 天堂а√在线中文在线最新版 | 亚洲国产成人一区二区三区 | 日韩亚洲欧美综合一区二区三区 | 免费无码精品黄av电影 | 99j久久精品久久久久久 | 国产亚洲精品久久久久久小说 | 欧美大尺度免费一级特黄 | 美国的毛片免费的 | 精品国产一区二区三区四区阿崩 | 亚洲福利视频精选在线视频 | 国产成人高清精品免费观看 | 香蕉久久av一区二区三区 | 大岛优香久久中文字幕 | 国产精品自在线拍国产手青青机版 | 一区二区三区免费看 | 久久精品国产www456c0m | 欧美日韩成人免费视频 | 国产丝袜大长腿精品丝袜美女 | 97成人精品 | 亚洲欧洲日韩综合色天使不卡 | 亚洲成色www久久网站 | 国产成人区 | 国产成人18黄网站 | 日本一级毛片视频网站 | 亚洲香蕉网综合久久 | 高清性做爰免费网站 | 蜜桃av抽搐高潮一区二区 | 欧美v日本| 亚洲熟妇av乱码在线观看 |