如何告诉 Ubuntu 硬件时钟是本地时间?
此命令没有帮助:
timedatectl set-local-rtc 1
答案1
在 Ubuntu 版本中,使用systemd
命令将时间更改为本地时间并立即更新时钟
timedatectl set-local-rtc 1 --adjust-system-clock
如果你运行timedatectl
,它会显示一个警告
Local time: ...
Universal time: ...
RTC time: ...
Time zone: ...
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 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'.
此警告并不意味着它被设置为 0。如果将其设置为 0,timedatectl status 会显示:
RTC in local TZ: no
并且没有警告。
RTC in local TZ: yes
如果您是双启动,则为首选。建议的命令是将 RTC 切换回“否”。