ubuntu系统调整系统时间

网友投稿 1056 2022-08-23

ubuntu系统调整系统时间

ubuntu系统调整系统时间

今天发现ubuntu的时区不对,所以调整了一下,把调整过程分享出来:

terminal输入命令:

TZselect

然后按照下面的操作就行了

Please identify a location so that time zone rules can be set correctly.Please select a continent, ocean, "coord", or "TZ". 1) Africa 2) Americas 3) Antarctica 4) Asia 5) Atlantic Ocean 6) Australia 7) Europe 8) Indian Ocean 9) Pacific Ocean10) coord - I want to use geographical coordinates.11) TZ - I want to specify the time zone using the Posix TZ format.#? 4Please select a country whose clocks agree with yours. 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) Taiwan10) Cyprus 27) Lebanon 44) Tajikistan11) East Timor 28) Macau 45) Thailand12) Georgia 29) Malaysia 46) Turkmenistan13) Hong Kong 30) Mongolia 47) United Arab Emirates14) India 31) Myanmar (Burma) 48) Uzbekistan15) Indonesia 32) Nepal 49) Vietnam16) Iran 33) Oman 50) Yemen17) Iraq 34) Pakistan#? 9Please select one of the following time zone regions.1) Beijing Time2) Xinjiang Time#? 1The following information has been given: China Beijing TimeTherefore TZ='Asia/Shanghai' will be used.Local time is now: Wed Mar 2 10:04:45 CST 2022.Universal Time is now: Wed Mar 2 02:04:45 UTC 2022.Is the above information OK?1) Yes2) No#? 1You can make this change permanent for yourself by appending the line TZ='Asia/Shanghai'; export TZto 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 youcan use the /usr/bin/tzselect command in shell scripts:Asia/Shanghai

如果使用date命令,系统时间还是没变,可以使用下面的命令。

cp /etc/localtime /etc/localtime.bak'/etc/localtime' -> '/usr/share/zoneinfo/Asia/Shanghai'

参考文献

[1].如何调整Linux系统为正确时区. [2].自动调整linux系统时间和时区与Internet时间同步. https://blog./liumissyou/1302050

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:iOS 性能调优,成为一名合格 iOS 程序员必须掌握(ios16什么时候可以更新)
下一篇:构建 Android 应用程序一定要绕过的 30 个坑(构建新发展格局)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~