2
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 3 years have passed since last update.

Amazon Linux 2 日付変更

Posted at

タイムゾーンの変更

調べてたら幾つか方法があるみたいなのでそれぞれメモ

方法1.設定ファイルの書き換え

1) /etc/sysconfig/clockの書き換え

# vi /etc/sysconfig/clock
/etc/sysconfig/clock
ZONE="UTC"
UTC=true

「ZONE」を変更↓

/etc/sysconfig/clock
ZONE="Asia/Tokyo"
UTC=true

2) シンボリックリンクの更新

# ln -sf  /usr/share/zoneinfo/Asia/Tokyo /etc/localtime

3) シンボリックリンクの確認

# ll /etc/localtime
~~~ /etc/localtime -> ../usr/share/zoneinfo/Asia/Tokyo

方法2.timedatectl コマンドを使う

1) timedatectl コマンド

# timedatectl set-timezone Asia/Tokyo

2) シンボリックリンクの確認

# ll /etc/localtime
~~~ /etc/localtime -> ../usr/share/zoneinfo/Asia/Tokyo

同じ結果でした!!!
なお「/etc/sysconfig/clock」は元の「ZONE="UTC"」に戻っていました。

2
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
2
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?