128
98

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

ubuntu 18.04 時刻とタイムゾーン設定

Posted at

タイムゾーンの設定

18.04新規インストール時はデフォルトではUTCになっていて9時間ずれていたので設定する。
(というか、OSインストール時にタイムゾーンを設定するタイミングがなかったような…)

root@epoisses:~# date
Sat Oct 20 01:07:35 UTC 2018
root@epoisses:~# timedatectl
                      Local time: Sat 2018-10-20 01:07:58 UTC
                  Universal time: Sat 2018-10-20 01:07:58 UTC
                        RTC time: Sat 2018-10-20 01:07:59
                       Time zone: Etc/UTC (UTC, +0000)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
root@epoisses:~# timedatectl list-timezones | grep -i tokyo
Asia/Tokyo

設定

root@epoisses:~# timedatectl set-timezone Asia/Tokyo
root@epoisses:~# timedatectl
                      Local time: Sat 2018-10-20 10:09:15 JST
                  Universal time: Sat 2018-10-20 01:09:15 UTC
                        RTC time: Sat 2018-10-20 01:09:16
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: yes
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
root@epoisses:~# date
Sat Oct 20 10:09:18 JST 2018
root@epoisses:~#

時刻の設定

メモが残ってたので張り付けておく。。

root@cheddar:~# timedatectl set-time "2018-08-15 07:20:00"
Failed to set time: Automatic time synchronization is enabled
root@cheddar:~# timedatectl status
                      Local time: Wed 2018-08-15 16:21:29 JST
                  Universal time: Wed 2018-08-15 07:21:29 UTC
                        RTC time: Wed 2018-08-15 07:21:28
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
root@cheddar:~# timedatectl set-ntp no
root@cheddar:~# timedatectl set-time "2018-08-15 07:22:00"
root@cheddar:~# timedatectl set-ntp yes
root@cheddar:~# timedatectl status
                      Local time: Wed 2018-08-15 07:22:04 JST
                  Universal time: Tue 2018-08-14 22:22:04 UTC
                        RTC time: Tue 2018-08-14 22:22:05
                       Time zone: Asia/Tokyo (JST, +0900)
       System clock synchronized: no
systemd-timesyncd.service active: yes
                 RTC in local TZ: no
root@cheddar:~# 
128
98
1

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
128
98

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?