CentOS Stream 9でタイムゾーンを設定する方法

環境
CentOS Stream release 9

コマンド
sudo timedatectl set-timezone タイムゾーン名

操作方法
1.指定可能のタイムゾーンを確認します

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
# timedatectl list-timezones Africa/Abidjan Africa/Accra Africa/Addis_Ababa 略
# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
略

2.例東京のタイムゾーンを設定します「Asia/Tokyo」にします

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# sudo timedatectl set-timezone Asia/Tokyo
# sudo timedatectl set-timezone Asia/Tokyo
# sudo timedatectl set-timezone Asia/Tokyo

3.設定後確認

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
# timedatectl
Local time: 土 2022-10-15 05:13:01 JST
Universal time: 金 2022-10-14 20:13:01 UTC
RTC time: 金 2022-10-14 20:13:01
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
# timedatectl Local time: 土 2022-10-15 05:13:01 JST Universal time: 金 2022-10-14 20:13:01 UTC RTC time: 金 2022-10-14 20:13:01 Time zone: Asia/Tokyo (JST, +0900) System clock synchronized: yes NTP service: active RTC in local TZ: no
# timedatectl
               Local time: 土 2022-10-15 05:13:01 JST
           Universal time: 金 2022-10-14 20:13:01 UTC
                 RTC time: 金 2022-10-14 20:13:01
                Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

 

CentOS Stream 9

Posted by arkgame