1.
# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime // 兩句是等效的
2.
# timedatectl set-timezone Asia/Shanghai //修改時區為Asia/Shanghai
# timedatectl //查詢服務器時間
3.
# tzselect // 然后根據提示進行選擇:5,9,1,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
查詢時間后,仍然沒有改過來。
安裝提示操作:
# export TZ='Asia/Shanghai' // 測試后,發現只是臨時有效,重啟后不起作用了
