timedatectl 查看当前时间
tzselect 设置时区
┌──(root㉿kali)-[~]
└─# 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 Ocean
10) coord - I want to use geographical coordinates.
11) TZ - I want to specify the timezone using the Posix TZ format.
#? 4
Please select a country whose clocks agree with yours.
1) Afghanistan 20) Iran 39) Palestine
2) Antarctica 21) Iraq 40) Philippines
3) Armenia 22) Israel 41) Qatar
4) Azerbaijan 23) Japan 42) Réunion
5) Bahrain 24) Jordan 43) Russia
6) Bangladesh 25) Kazakhstan 44) Saudi Arabia
7) Bhutan 26) Korea (North) 45) Seychelles
8) Brunei 27) Korea (South) 46) Singapore
9) Cambodia 28) Kuwait 47) Sri Lanka
10) China 29) Kyrgyzstan 48) Syria
11) Christmas Island 30) Laos 49) Taiwan
12) Cocos (Keeling) Islands 31) Lebanon 50) Tajikistan
13) Cyprus 32) Macau 51) Thailand
14) East Timor 33) Malaysia 52) Turkmenistan
15) French Southern Territories 34) Mongolia 53) United Arab Emirates
16) Georgia 35) Myanmar (Burma) 54) Uzbekistan
17) Hong Kong 36) Nepal 55) Vietnam
18) India 37) Oman 56) Yemen
19) Indonesia 38) Pakistan
#? 10
Please select one of the following timezones.
1) Beijing Time
2) Xinjiang Time, Vostok
#? 1
The following information has been given:
China
Beijing Time
Therefore TZ='Asia/Shanghai' will be used.
Selected time is now: Fri Mar 24 10:58:31 CST 2023.
Universal Time is now: Fri Mar 24 02:58:31 UTC 2023.
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
echo "ZONE=Asia/Shanghai" >> /etc/sysconfig
rm -f /etc/localtime
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date
timedatectl
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net