系统篇: ubuntu 下设置系统时区

一、查看系统时间

guchunqi@it00034930:~$ date
Wed Jun 30 06:37:16 UTC 2021

二、修改系统时区

方法一
  • 直接拷贝时区文件
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
方法二
  • 用timedatectl查看当前时间
guchunqi@it00034930:~$ timedatectl status
                      Local time: Wed 2021-06-30 14:53:45 CST
                  Universal time: Wed 2021-06-30 06:53:45 UTC
                        RTC time: Wed 2021-06-30 06:53:45
                       Time zone: Etc/UTC (CST, +0800)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
  • 用timedatectl修改时区
==== AUTHENTICATING FOR org.freedesktop.timedate1.set-timezone ===
Authentication is required to set the system timezone.
Authenticating as: it00034930 (cvte)
Password:
==== AUTHENTICATION COMPLETE ===

你可能感兴趣的:(#,Linux系统篇,ubuntu,linux,运维)