2021-01-27 CentOS系统将UTC时间修改为CST时间方法
生活随笔
收集整理的這篇文章主要介紹了
2021-01-27 CentOS系统将UTC时间修改为CST时间方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
CentOS系統將UTC時間修改為CST時間方法
世界協調時間(Universal Time Coordinated,UTC):
GPS 系統中有兩種時間區分,一為UTC,另一為LT(地方時)兩者的區別為時區不同,UTC就是0時區的時間,地方時為本地時間,如北京為早上八點(東八區),UTC時間就為零點,時間比北京時晚八小時,以此計算即可。
date
2021年 1月 26日 星期日 03:08:23?UTC
可以執行tzselect命令按提示更換時區,依次選擇5-Asia,9-China,1-Beijing Time。
tzselect Please identify a location so that time zone rules can be set correctly. Please select a continent or ocean.1) Africa2) Americas3) Antarctica4) Arctic Ocean5) Asia6) Atlantic Ocean7) Australia8) Europe9) Indian Ocean 10) Pacific Ocean 11) none - I want to specify the time zone using the Posix TZ format. #??5Please select a country.1) Afghanistan? ? 18) Israel? ? ? 35) Palestine2) Armenia? ? 19) Japan? ? ? 36) Philippines3) Azerbaijan? ? 20) Jordan? ? ? 37) Qatar4) Bahrain? ? 21) Kazakhstan? ? 38) Russia5) Bangladesh? ? 22) Korea (North)? ? 39) Saudi Arabia6) Bhutan? ? 23) Korea (South)? ? 40) Singapore7) Brunei? ? 24) Kuwait? ? ? 41) Sri Lanka8) Cambodia? ? 25) Kyrgyzstan? ? 42) Syria9) 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 #??9Please select one of the following time zone regions. 1)?Beijing Time 2) Xinjiang Time #??1The following information has been given:ChinaBeijing TimeTherefore TZ='Asia/Shanghai' will be used. Local time is now:?Sun Oct 28 11:12:54 CST 2018. Universal Time is now:?Sun Oct 28 03:12:54 UTC 2018. Is the above information OK? 1)?Yes 2) No #??1永久修改時間
1.將
TZ='Asia/Shanghai' export TZ添加到/etc/profile(所有用戶生效)或者~/.bash_profile(當前用戶生效)
2.退出重新登錄即可,也可執行source /etc/profile或source ~/.bash_profile立即生效
3.這時候再執行date查看日期就可以發現時區改為北京時間啦。
date 2021年 1月 26日 星期日 11:26:14 CST經過以上步驟,我們的CentOS Linux系統時間和計算機硬件時間終于都是CST時間了,并且都是北京時間。
?
總結
以上是生活随笔為你收集整理的2021-01-27 CentOS系统将UTC时间修改为CST时间方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2021-01-26 粒子群优化算法(P
- 下一篇: 2021-01-27 计算机-进程与线程