1. 查看当前系统的时间用date命令

root@infokist:/# date
Thu 21 Apr 2022 09:06:06 PM CST

2 . 运行tzselect来选择时区

root@infokist:/# 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           14) Hong Kong             27) Laos                  40) Saudi Arabia
 2) Antarctica            15) India                 28) Lebanon               41) Singapore
 3) Armenia               16) Indonesia             29) Macau                 42) Sri Lanka
 4) Azerbaijan            17) Iran                  30) Malaysia              43) Syria
 5) Bahrain               18) Iraq                  31) Mongolia              44) Taiwan
 6) Bangladesh            19) Israel                32) Myanmar (Burma)       45) Tajikistan
 7) Bhutan                20) Japan                 33) Nepal                 46) Thailand
 8) Brunei                21) Jordan                34) Oman                  47) Turkmenistan
 9) Cambodia              22) Kazakhstan            35) Pakistan              48) United Arab Emirates
10) China                 23) Korea (North)         36) Palestine             49) Uzbekistan
11) Cyprus                24) Korea (South)         37) Philippines           50) Vietnam
12) East Timor            25) Kuwait                38) Qatar                 51) Yemen
13) Georgia               26) Kyrgyzstan            39) Russia
#? 10
Please select one of the following timezones.
1) Beijing Time
2) Xinjiang Time
#? 1

The following information has been given:

        China
        Beijing Time

Therefore TZ='Asia/Shanghai' will be used.
Selected time is now:   Thu Apr 21 21:00:16 CST 2022.
Universal Time is now:  Thu Apr 21 13:00:16 UTC 2022.
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 

3. 复制文件到/etc/localtime目录下

root@infokist:/# cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 

4. 设置时间

root@infokist:/# date -s 2023/04/24
Mon 24 Apr 2023 12:00:00 AM CST
root@infokist:/# date -s 11:26:24
Mon 24 Apr 2023 11:26:24 AM CST

5. 修改硬件的CMOS时间

root@infokist:/# hwclock --systohc