タイムゾーンの設定
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:~#