99
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

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

タイムゾーンの設定

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:~# 
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
99
Help us understand the problem. What are the problem?