When I ran ** date **, the system clock was out of order. Rather, it was 9 hours later than ** UTC (Coordinated Universal Time) ** because the time zone could not be set, so I will set it to Japan Standard Time. Japan's standard time is ** UTC + 09: 00 ** because there is a 9-hour time difference from Coordinated Universal Time.
Ubuntu 16.04.5 LTS
Refer to the current time zone setting.
$timedatectl
Local time: Mon 2020-01-06 05:04:33 UTC
Universal time: Mon 2020-01-06 05:04:33 UTC
RTC time: Mon 2020-01-06 05:04:33
Time zone: Etc/UTC (UTC, +0000)
Network time on: yes
NTP synchronized: no
RTC in local TZ: no
```
Confirm that Japan Standard Time can be set.
```cmd
$timedatectl list-timezones | grep Tokyo
Asia/Tokyo
```
Set to Japan Standard Time.
```cmd
$sudo timedatectl set-timezone Asia/Tokyo
```
Make sure it is set correctly.
```cmd
timedatectl
Local time: Mon 2020-01-06 14:06:12 JST
Universal time: Mon 2020-01-06 05:06:12 UTC
RTC time: Mon 2020-01-06 05:06:12
Time zone: Asia/Tokyo (JST, +0900)
Network time on: yes
NTP synchronized: no
RTC in local TZ: no
```
Check that the system clock is displayed correctly.
```cmd
date
```
When I checked the hardware clock, it was fixed together.
```cmd
hwclock -r
```
# Reference article
https://qiita.com/koara-local/items/32b004c0bf80fd70777c
Recommended Posts