Ubuntu 22.04 修改时区
当前系统时间
tester@server01:/etc$ date
Fri Sep 2 02:03:04 AM UTC 2022
查看当前系统时间及对应时区
tester@server01:/etc$ timedatectl
Local time: Fri 2022-09-02 02:03:27 UTC
Universal time: Fri 2022-09-02 02:03:27 UTC
RTC time: Fri 2022-09-02 02:03:27
Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
罗列可用时区
tester@server01:/etc$ timedatectl list-timezones
设置时区
sudo timedatectl set-timezone Asia/Shanghai
设置成功后的结果
tester@server01:/etc$ date
Fri Sep 2 10:03:56 AM CST 2022
tester@server01:/etc$ timedatectl
Local time: Fri 2022-09-02 10:05:25 CST
Universal time: Fri 2022-09-02 02:05:25 UTC
RTC time: Fri 2022-09-02 02:05:25
Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no