如何告诉 Ubuntu 硬件时钟是当地时间?

Dim*_*ims 4 time rtc 16.04

如何告诉 Ubuntu 硬件时钟是当地时间?

此命令没有帮助:

timedatectl set-local-rtc 1
Run Code Online (Sandbox Code Playgroud)

Pil*_*ot6 10

在使用systemd命令将时间更改为本地并立即更新时钟的Ubuntu 版本中

timedatectl set-local-rtc 1 --adjust-system-clock
Run Code Online (Sandbox Code Playgroud)

如果你运行timedatectl,它会显示一个警告

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'.
Run Code Online (Sandbox Code Playgroud)

这个警告并不意味着它被设置为 0。如果它被设置为 0,timedatectl status 会显示:“本地 TZ 中的 RTC:否”并且没有警告。如果您是双引导,则首选“本地 TZ 中的 RTC:是”。建议的命令用于将 RTC 切换回“no”。