版本:ubuntu 16.04
時區:台北
Network time on:no
NTP synchronized:no
ubuntu的時間更改為以下
timedatectl set-time "20:10:10"
即更改local time時間
但ubuntu重開機後local time會自行校時
需求是重開機維持上次更改的時間,要怎麼修改呢?
您的資訊不足部份:
基本原理是:
所以您說時間會跑掉, 可能的猜測是:
$ timedatectl status
Local time: 四 2017-05-11 13:36:23 CST
Universal time: 四 2017-05-11 05:36:23 UTC
RTC time: 四 2017-05-11 13:36:23
Time zone: Asia/Taipei (CST, +0800)
Network time on: yes
NTP synchronized: yes
RTC in local TZ: yes
Warning: The system is configured to read the RTC time in the local time zone.This mode can not 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'.
您會看到輸出的後面有一堆"忠言", 建議您不要這樣做. 出乎無奈, 就認了吧. 這時 就應該啟用NTP來校正系統本地時間(CST), 讓它能自動校正時間.