0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[CentOS 8]タイムゾーンの設定方法(メモ)

Last updated at Posted at 2020-07-13

タイムゾーンの設定方法の覚書

書いておかないとすぐに忘れてしまうので、メモを残しています。

OS バージョン

$ cat /etc/redhat-release
CentOS Linux release 8.2.2004 (Core)

設定方法

現状のタイムゾーンの確認

$ timedatectl
               Local time: 月 2020-07-13 10:23:08 JST
           Universal time: 月 2020-07-13 01:23:08 UTC
                 RTC time: 月 2020-07-13 01:23:07
                Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

現状は「Asia/Tokyo」

タイムゾーンの一覧を確認

$ timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
・・・
$ timedatectl list-timezones | grep Shanghai
Asia/Shanghai

ここでは「Asia/Shanghai」に設定する。

タイムゾーンの設定

$ sudo timedatectl set-timezone Asia/Shanghai

確認

$ timedatectl
               Local time: 月 2020-07-13 09:23:51 CST
           Universal time: 月 2020-07-13 01:23:51 UTC
                 RTC time: 月 2020-07-13 01:23:49
                Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?