Ubuntu 18.04 修改时区

1,查看当前时区

# cat /etc/issue
Ubuntu 18.04.5 LTS \n \l
# date -R
Tue, 01 Sep 2020 15:41:11 +0000
# timedatectl
                      Local time: Tue 2020-09-01 15:41:28 UTC
                  Universal time: Tue 2020-09-01 15:41:28 UTC
                        RTC time: Tue 2020-09-01 15:41:27
                       Time zone: Etc/UTC (UTC, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
# ls -l /etc/localtime
lrwxrwxrwx 1 root root 27 Aug  3 07:16 /etc/localtime -> /usr/share/zoneinfo/Etc/UTC

2,时区设置为上海

timedatectl list-timezones
timedatectl set-timezone Asia/Shanghai
# timedatectl
                      Local time: Tue 2020-09-01 23:45:54 CST
                  Universal time: Tue 2020-09-01 15:45:54 UTC
                        RTC time: Tue 2020-09-01 15:45:54
                       Time zone: Asia/Shanghai (CST, +0800)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
# ls -l /etc/localtime
lrwxrwxrwx 1 root root 35 Sep  1 23:44 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai

参考:

  1. 如何在Ubuntu 18.04 Server上更改时区

猜你喜欢

转载自blog.csdn.net/u010953692/article/details/108353218