LoginSignup
0
0

More than 5 years have passed since last update.

CentOS7でズレた時刻を調整する

Posted at

使っている環境の時刻がズレている事ってよくありますよね?
そんなズレを正しく調整する時のメモです。

cli
# 確認(タイムゾーンと時刻が正しくない)
$ timedatectl
      Local time: 火 2016-11-22 03:22:54 CET
  Universal time: 火 2016-11-22 02:22:54 UTC
        Timezone: Europe/Berlin (CET, +0100)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: no
 Last DST change: DST ended at
                  日 2016-10-30 02:59:59 CEST
                  日 2016-10-30 02:00:00 CET
 Next DST change: DST begins (the clock jumps one hour forward) at
                  日 2017-03-26 01:59:59 CET
                  日 2017-03-26 03:00:00 CEST

#タイムゾーンの設定
$ sudo timedatectl set-timezone Asia/Tokyo

# 時刻を調整
$ sudo ntpdate ntp.nict.jp

# 確認(正しく現在時刻が設定されました)
$ timedatectl
      Local time: 火 2016-11-22 11:45:33 JST
  Universal time: 火 2016-11-22 02:45:33 UTC
        Timezone: Asia/Tokyo (JST, +0900)
     NTP enabled: yes
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a

20分以上ズレてた。。。:astonished:

参考

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