LoginSignup
12
12

More than 5 years have passed since last update.

最近のLinuxディストリビューションでタイムゾーンを変更するモダンな方法

Posted at

はじめに

systemdが導入されている最近のLinuxディストリビューションでタイムゾーン変更の方法を記す。Ubuntu14.04でもCentOS7でも使えるはずである。

もともとのタイムゾーン設定が以下のようになっていると仮定する。なお、ここから先はUbuntu14.04での作業を想定している。

$ date
Thu Jan 14 00:39:19 UTC 2016
$ cat /etc/timezone
Etc/UTC

timedatectl

rootユーザで以下のコマンドを実行する。

# timedatectl set-timezone Asia/Tokyo

タイムゾーンを確認する。

$ date
Thu Jan 14 09:46:15 JST 2016
$ cat /etc/timezone
Asia/Tokyo

ちなみにtimedatectlコマンドはsystemdのパッケージである。

以上。

12
12
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
12
12