Discuz! BBS

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2669|回复: 1

修改linux时区

[复制链接]

480

主题

660

帖子

3881

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3881
发表于 2023-7-9 19:13:34 | 显示全部楼层 |阅读模式
1)sudo ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
2)sudo echo "Asia/Shanghai" > /etc/timezone
这两步都要做。然后reboot一下就可以。注意修改第二个之前先保存一下文件。
ref:https://www.999art.com/news/44484.html
回复

使用道具 举报

480

主题

660

帖子

3881

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3881
 楼主| 发表于 2026-2-9 22:18:34 | 显示全部楼层
Ubuntu 24.04 修改时区:
timedatectl set-ntp true

timedatectl show
现在时区时间
timedatectl status
本地和格林威治时间,以及本机硬件时间
timedatectl set-local-rtc 1
          RTC in local TZ: yes

Warning: The system is configured to read the RTC time in the local time zone.
         This mode cannot 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'.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|DiscuzX

GMT+8, 2026-3-22 06:02 , Processed in 0.014569 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表