ubuntu(Linux)とwindowsのデュアルブートしてると時刻が9時間ずれて、時間を見るサービスなんかでよくプチトラブルに遭遇する。
WindowsではJSTで管理、LinuxではUTCで管理するせいとのこと。
なのでどっちかに合わせる必要があるということでUbuntuで修正する。
で、その方法が2種類あるみたい。
$ sudo hwclock -D --systohc --localtime
$ sudo timedatectl set-local-rtc true
Ubuntu22.04で後者を実行したけど、Warningが出てるんであんま良くないみたい。しばらく様子見するか。
$ timedatectl
Local time: 月 2023-05-15 22:28:12 JST
Universal time: 月 2023-05-15 13:28:12 UTC
RTC time: 月 2023-05-15 13:28:11
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
$
$ sudo timedatectl set-local-rtc true
$
$ timedatectl
Local time: 月 2023-05-15 22:29:25 JST
Universal time: 月 2023-05-15 13:29:25 UTC
RTC time: 月 2023-05-15 22:29:26
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: yes
Warning: The system is configured to read the RTC time in the local time zone.
This mode cannot be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
'timedatectl set-local-rtc 0'.
$
WindowsではJSTで管理、LinuxではUTCで管理するせいとのこと。
なのでどっちかに合わせる必要があるということでUbuntuで修正する。
で、その方法が2種類あるみたい。
$ sudo hwclock -D --systohc --localtime
$ sudo timedatectl set-local-rtc true
Ubuntu22.04で後者を実行したけど、Warningが出てるんであんま良くないみたい。しばらく様子見するか。
$ timedatectl
Local time: 月 2023-05-15 22:28:12 JST
Universal time: 月 2023-05-15 13:28:12 UTC
RTC time: 月 2023-05-15 13:28:11
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: no
$
$ sudo timedatectl set-local-rtc true
$
$ timedatectl
Local time: 月 2023-05-15 22:29:25 JST
Universal time: 月 2023-05-15 13:29:25 UTC
RTC time: 月 2023-05-15 22:29:26
Time zone: Asia/Tokyo (JST, +0900)
System clock synchronized: yes
NTP service: active
RTC in local TZ: yes
Warning: The system is configured to read the RTC time in the local time zone.
This mode cannot be fully supported. It will create various problems
with time zone changes and daylight saving time adjustments. The RTC
time is never updated, it relies on external facilities to maintain it.
If at all possible, use RTC in UTC by calling
'timedatectl set-local-rtc 0'.
$
※コメント投稿者のブログIDはブログ作成者のみに通知されます