LoginSignup
0
1

More than 5 years have passed since last update.

【CentOS7.5】タイムゾーンの設定

Last updated at Posted at 2018-11-06

作業環境

CentOS 7.5
macOS 10系

参考

このサイトに倣って作業を行います。ありがたや〜です!

手順

現在の設定を確認

# timedatectl
      Local time: 火 2018-11-06 02:56:53 UTC
  Universal time: 火 2018-11-06 02:56:53 UTC
        RTC time: 火 2018-11-06 02:56:52
       Time zone: UTC (UTC, +0000)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

timedatectlってなんだろう。。と思いつつコマンド入力。
デフォルトだとUTCなんですね(そりゃそうだ)。

タイムゾーンの一覧からAsia/Tokyoを検索

# timedatectl list-timezones | grep -i asia/tokyo
Asia/Tokyo

grepしなかったら当然ですが一覧がわーっと出力されます。最初やりました。

タイムゾーンの変更

# timedatectl set-timezone Asia/Tokyo
# timedatectl
      Local time: 火 2018-11-06 12:02:13 JST
  Universal time: 火 2018-11-06 03:02:13 UTC
        RTC time: 火 2018-11-06 03:02:13
       Time zone: Asia/Tokyo (JST, +0900)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: n/a

本題。Asia/Tokyoを指定して設定が反映されているか確認します。
再起動が必要なのかなーと思ってましたが即時反映されました。
この手順は永続的なものですので、サービスのenableは不要です。

公式ドキュメントを見るまでもない手順でさえすぐに忘れるぼくのメモリはなんなのでしょうか。。
Showroomの前田裕二さんがメモは外部HDD、と仰られていたのでそれを信じることにします!
簡単ですが以上です。

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