LoginSignup
8
7

More than 3 years have passed since last update.

Amazon Linux 2(EC2)で時刻(タイムゾーン)と言語を日本に設定

Posted at

Amazon Linuxが安いのでよく使います。が、毎回タイムゾーンと言語設定を直しています。
(日本は時差ないし、母国語は日本語だけだがら、作成したリージョンに対応したタイムゾーンと言語に設定して欲しい)

時刻(タイムゾーン)を日本へ

設定
sudo timedatectl set-timezone Asia/Tokyo
  • ★1が日本時間
  • *1がタイムゾーン

になっていれば設定完了です。

確認
[ec2-user@ip-10-x-x-x ~]$ sudo timedatectl
      Local time: 水 2020-09-30 14:29:43 JST ★1
  Universal time: 水 2020-09-30 05:29:43 UTC
        RTC time: 水 2020-09-30 05:29:43
       Time zone: Asia/Tokyo (JST, +0900) ★2
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

言語を日本へ

今回は文字コードをUTF-8に設定します。
以下localectlで設定します。

設定
sudo localectl set-locale LANG=ja_JP.utf8

★のようになっていれば設定完了です。

確認
[ec2-user@ip-10-x-x-x ~]$ sudo localectl
   System Locale: LANG=ja_JP.utf8 ★
       VC Keymap: n/a
      X11 Layout: n/a
8
7
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
8
7