跳轉到內容

Debian 更改時區 / 同步時間

精選回覆

發表於

--------------------

時區時間

--------------------

瀏覽目前的時區

timedatectl

更改時區

timedatectl set-timezone Asia/Shanghai

再次瀏覽目前的時區

timedatectl

已經修改為 +8 時區 Time zone: Asia/Shanghai (CST, +0800)

--------------------

同步時間

--------------------

apt install systemd-timesyncd

vi /etc/systemd/timesyncd.conf

在底部,加入這一行

NTP=pool.ntp.org 0.asia.pool.ntp.org 1.asia.pool.ntp.org 2.asia.pool.ntp.org

儲存並離開

:wq

重新啟動

systemctl restart systemd-timesyncd

timedatectl show-timesync --all

timedatectl set-ntp true

瀏覽狀態

timedatectl timesync-status

瀏覽目前的時區時間

timedatectl

在 +8 時區,幾時幾分幾秒,都正常了

本文章最後於,由Jack編輯

建立帳號或登入後發表意見