Ubuntu20.04 用 `hwclock` 或 `timedatectl` 设置RTC硬件时钟为本地时区

Ubuntu20.04用 hwclocktimedatectl 设置硬件时区为本地时区

可以用hwclock命令

sudo hwclock --localtime --systohc

👆效果等同👇 , --localtime的简写是-l ; --systohc的简写是-w

sudo hwclock -l -w

也可以用timedatectl命令 👆效果等同👇

sudo timedatectl set-local-rtc 1




hwclock -l -w


-l, --localtime 本地时区 ; -u, --utc 统一世界协调时

   Indicate which timescale the Hardware Clock is set to.

指示硬件时钟设置为哪个时间刻度。

The Hardware Clock may be configured to use either the UTC or the local timescale, but nothing in the clock itself says which alternative is being used. The --localtime or --utc options

硬件时钟可以配置为使用UTC或本地时间刻度,但时钟本身没有说明正在使用哪种替代。--localtime--utc选项

give this information to the hwclock command. If you specify the wrong one (or specify neither and take a wrong default), both setting and reading the Hardware Clock will be incorrect.

将此信息提供给hwclock命令。如果您指定了错误的硬件时钟(或者既不指定也不使用错误的默认值),则硬件时钟的设置和读取都将不正确。

If you specify neither --utc nor --localtime then the one last given with a set function (--set, --systohc, or --adjust), as recorded in /etc/adjtime, will be used. If the adjtime file doesn’t exist, the default is UTC.

如果既不指定--utc也不指定--localtime,则将使用最后一个用set函数(–set、–systohc或–adjust)给定的,如/etc/adjtime中所记录的。如果adjtime文件不存在,默认值为UTC。

Note: daylight saving time changes may be inconsistent when the Hardware Clock is kept in local time. See the discussion below, under LOCAL vs UTC.
注意:当硬件时钟保持在本地时间时,夏令时变化可能不一致。请参阅下面的讨论,在本地与UTC下。



-w = --systohc 将系统时间写入硬件时间

	Set the Hardware Clock from the System Clock, and update the timestamps in /etc/adjtime. With the --update-drift option also (re)calculate the drift factor. Try it without the option if --systohc fails. See --update-drift below.

systohc可分解为sys系统to到h硬件c时钟
从系统时钟设置硬件时钟,并在/etc/adjtime中更新时间戳。使用--update-drift选项还(重新)计算漂移因子。如果--systohc失败,请尝试不使用该选项。




timedatectl set-local-rtc 1


  • 设置真实时钟(电子元件硬时钟)的时区为本地时区👇
sudo timedatectl set-local-rtc 1
  • 设置真实时钟(电子元件硬时钟)的时区为国际时区UTC👇
sudo timedatectl set-local-rtc 0
set-local-rtc

set-local-rtc [BOOL]
Takes a boolean argument. If “0”, the system is configured to
maintain the RTC in universal time. If “1”, it will maintain the
RTC in local time instead. Note that maintaining the RTC in the
local timezone is not fully supported and will create various
problems with time zone changes and daylight saving adjustments. If
at all possible, keep the RTC in UTC mode. Note that invoking this
will also synchronize the RTC from the system clock, unless
–adjust-system-clock is passed (see above). This command will
change the 3rd line of /etc/adjtime, as documented in hwclock(8).
接受一个布尔参数。如果为“0”,则系统配置为
保持RTC为世界时。如果“1”,它将保持
改为当地时间的RTC。注意,维护RTC在
不完全支持本地时区,并将创建各种
时区更改和夏令时调整的问题。如果
尽可能保持RTC为UTC模式。注意,调用这个
也将同步RTC从系统时钟,除非
-adjust-system-clock被传递(见上文)。

set-local-rtc [布尔值,0为否,1为是]

实时时钟的缩写是 RTC (Real_Time Clock)。RTC 是集成电路,通常称为时钟芯片。
实时时钟芯片是日常生活中应用最为广泛的消费类电子产品之一。它为人们提供精确的实时时间,或者为电子系统提供精确的时间基准,实时时钟芯片大多采用精度较高的晶体振荡器作为时钟源。有些时钟芯片为了在主电源掉电时,还可以工作,需要外加电池供电。

set-local-rtc 表示是否设置真实时钟(电子元件硬时钟)的时区为本地时区, 取值01

  • 0 表示 否, RTC=UTC
    UTC一般指协调世界时。 协调世界时,又称世界统一时间、世界标准时间、国际协调时间。
  • 1 表示 是, RTC=LOCAL本地时区
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
要将Ubuntu 20.04设置为全英文,您可以按照以下步骤进行操作: 1. 首先,打开Ubuntu主界面,然后点击右上角的系统设置图标。 2. 在系统设置中,找到并打开“语言支持”选项。 3. 在语言支持窗口中,您可以看到当前使用的语言列表。选择英语作为首选语言,并将其拖动到列表顶部。 4. 点击“应用到整个系统”按钮,系统将提示您进行一些配置更改。 5. 完成更改后,重启系统。在重新启动后,您会发现Ubuntu 20.04的界面已经完全变为英文。 需要注意的是,尽管您将Ubuntu设置为全英文,但仍然可能会有一些系统和应用程序界面仍然显示为英文。这是因为某些应用程序可能没有完全支持多语言界面。但是,大部分系统界面和核心应用程序都会变为英文。 希望以上信息能帮助到您。如果您还有其他问题,请随时提问。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Ubuntu零基础教学-如何把Ubuntu20.04界面从英文修改为中文?| 超级详细,建议收藏](https://blog.csdn.net/weixin_43970743/article/details/129991410)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

kfepiza

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值