這期內(nèi)容當(dāng)中小編將會給大家?guī)碛嘘P(guān)Linux 7 修改時區(qū)不生效怎么辦,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
成都創(chuàng)新互聯(lián)公司專注于息烽企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站建設(shè),商城網(wǎng)站定制開發(fā)。息烽網(wǎng)站建設(shè)公司,為息烽等地區(qū)提供建站服務(wù)。全流程按需制作,專業(yè)設(shè)計,全程項目跟蹤,成都創(chuàng)新互聯(lián)公司專業(yè)和態(tài)度為您提供的服務(wù)
查看當(dāng)前時區(qū)
[root@tidb01 ~]# date Sat Jun 27 13:58:27 EDT 2020 [root@tidb01 ~]# date -R Sat, 27 Jun 2020 13:58:36 -0400
修改時區(qū)
方法一:
[root@tidb01 ~]# ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime [root@tidb01 ~]# ls -l /etc/localtime lrwxrwxrwx 1 root root 35 Jun 28 02:08 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai
方法二:
[root@tidb01 ~]# timedatectl set-timezone Asia/Shanghai
方法三:
[root@tidb01 ~]# cat /etc/profile [root@tidb01 ~]# cat .bash_profile [root@tidb01 ~]# cat .bash_profile TZ='Asia/Shanghai'; export TZ
方法四:
[root@tidb01 ~]# tzselect 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. ......
查詢時區(qū)并沒有修改成功
[root@tidb01 ~]# date Sat Jun 27 13:58:50 EDT 2020
嘗試將其他東8區(qū)時區(qū)操作系統(tǒng)上的Shanghai文件拷貝過來
[root@tidb02 ~]# cp /usr/share/zoneinfo/Asia/Shanghai . [root@tidb02 ~]# scp Shanghai 192.168.30.101:/root
時區(qū)修改成功
[root@tidb01 ~]# date Sat Jun 27 14:23:04 CST 2020 [root@tidb01 ~]# date -R Sat, 27 Jun 2020 14:23:13 +0800
上述就是小編為大家分享的Linux 7 修改時區(qū)不生效怎么辦了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識,歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
文章題目:Linux7修改時區(qū)不生效怎么辦
當(dāng)前地址:http://jinyejixie.com/article34/pshope.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供軟件開發(fā)、自適應(yīng)網(wǎng)站、微信公眾號、網(wǎng)站維護(hù)、品牌網(wǎng)站建設(shè)、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)