0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Ubuntu24.04の時刻合わせ

0
Posted at

仮想マシンにubuntu24.04をインストールしたら、時刻がずれていたので修正した時の作業メモ

UTCからJSTに変更

まず大きく時刻がずれていたので確認したらUTCになっていたのでJSTに変更します。

現場確認

とりあえずdateコマンドを実行して時刻を確認します。

date
dateコマンドの結果
Wed Mar  4 06:00:04 AM UTC 2026

想定通りUTCになっていました。

timedatectl コマンドを使う

現在のUbuntu(systemdを採用しているバージョン)で最も標準的な方法

sudo timedatectl set-timezone Asia/Tokyo

変更後の確認

dateコマンドで変更が反映されたか確認します。

```bash:dateコマンドの結果
Wed Mar  4 03:01:33 PM JST 2026

時刻合わせ

UTCからJSTにしたが、ホストのPCの時刻から約20分ずれていたので、それも修正していきます。

sudo timedatectl set-ntp yes

dateコマンドで確認します。

dateコマンドの結果
Wed Mar  4 03:02:55 PM JST 2026

今回はうまいこと直りませんでした。。。
ということで、強制的に時刻合わせします。

sudo systemctl restart systemd-timesyncd

数秒時間をおいてdateコマンドで確認したところ時刻がホストPCと同じになっていました。

Wed Mar  4 03:21:34 PM JST 2026

ということで無事正しい時刻になりました。

0
0
0

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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?