[Ubuntu 20.04]タイムゾーンを設定する方法

1.OSバージョン確認
# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS"
2.日付確認
# date
Thu 25 Mar 2021 07:20:45 PM PDT
タイムゾーンを確認
# timedatectl
Local time: Thu 2021-03-25 19:20:55 PDT
Universal time: Fri 2021-03-26 02:20:55 UTC
RTC time: Fri 2021-03-26 02:20:55
Time zone: America/Los_Angeles (PDT, -0700)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
3.タイムゾーンを設定
# timedatectl set-timezone Asia/Tokyo
# timedatectl
Local time: Fri 2021-03-26 11:22:04 JST
Universal time: Fri 2021-03-26 02:22:04 UTC
RTC time: Fri 2021-03-26 02:22:04
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
4.再度日付確認
# date
Fri 26 Mar 2021 11:22:28 AM JST

Ubuntu

Posted by arkgame