LoginSignup
3
7

More than 5 years have passed since last update.

【CentOS7】システム時刻を9時間戻す手順

Posted at

■事象

CentOS7をインストールしたらシステム時刻が9時間進んでいた

コマンドライン
[root@localhost ~]# date
2017年 10月 13日 金曜日 22:03:36 JST
[root@localhost ~]#
コマンドライン
# timedatectl
[root@localhost ~]# timedatectl
      Local time: 金 2017-10-13 22:03:39 JST
  Universal time: 金 2017-10-13 13:03:39 UTC
        RTC time: 金 2017-10-13 13:03:38
       Time zone: Asia/Tokyo (JST, +0900)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

■原因

RTC(ハードウェアクロック)が"UTC"になっていた

■対処

# hwclock -s --localtime

コマンドライン
[root@localhost ~]# hwclock -s --localtime
[root@localhost ~]#
[root@localhost ~]# timedatectl
      Local time: 金 2017-10-13 13:05:34 JST
  Universal time: 金 2017-10-13 04:05:34 UTC
        RTC time: 金 2017-10-13 13:05:34
       Time zone: Asia/Tokyo (JST, +0900)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

# timedatectl set-local-rtc true

コマンドライン
[root@localhost ~]# timedatectl set-local-rtc true
[root@localhost ~]# 
[root@localhost ~]# timedatectl
      Local time: 金 2017-10-13 13:23:25 JST
  Universal time: 金 2017-10-13 04:23:25 UTC
        RTC time: 金 2017-10-13 13:23:25
       Time zone: Asia/Tokyo (JST, +0900)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: yes
      DST active: n/a

Warning: The system is configured to read the RTC time in the local time zone.
         This mode can not be fully supported. It will create various problems
         with time zone changes and daylight saving time adjustments. The RTC
         time is never updated, it relies on external facilities to maintain it.
         If at all possible, use RTC in UTC by calling
         'timedatectl set-local-rtc 0'.
[root@localhost ~]#
3
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
3
7