[CentOS7]サーバのタイムゾーンの設定
サーバの初期設定はUTCの設定になっているので、日本時間にする場合以下のコマンドを実行します。
<変更前>
# timedatectl
Local time: Sat 2019-11-23 01:12:28 UTC
Universal time: Sat 2019-11-23 01:12:28 UTC
RTC time: Sat 2019-11-23 01:12:22
Time zone: UTC (UTC, +0000)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
<日本時間へ変更>
# timedatectl set-timezone Asia/Tokyo
<変更後>
# timedatectl
Local time: Sat 2019-11-23 10:23:47 JST
Universal time: Sat 2019-11-23 01:23:47 UTC
RTC time: Sat 2019-11-23 01:23:41
Time zone: Asia/Tokyo (JST, +0900)
NTP enabled: yes
NTP synchronized: no
RTC in local TZ: no
DST active: n/a
設定可能なタイムゾーンを表示
# timedatectl list-timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
…
タイムゾーンファイルの置き場所
# cd /usr/share/zoneinfo/
[root@ip-10-150-9-70 zoneinfo]# ll
total 392
drwxr-xr-x 2 root root 4096 Mar 5 2019 Africa
drwxr-xr-x 6 root root 8192 Mar 5 2019 America
drwxr-xr-x 2 root root 187 Mar 5 2019 Antarctica
…
※ファイルの中身を書き換えるとPHPの時間処理(Datetimeクラスなど)に影響が出るため慎重に検討する必要があります。
Author And Source
この問題について([CentOS7]サーバのタイムゾーンの設定), 我々は、より多くの情報をここで見つけました https://qiita.com/yuusuke_yoshikawa/items/0742c7d081d12399fa39著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .