乌班图更改系统时间为上海
张凯旋 8/29 15:06:38
1. 强制设置时区为 Asia/Shanghai(覆盖所有配置文件)
sudo timedatectl set-timezone Asia/Shanghai
2. 重启 systemd 时区服务(确保配置生效)
sudo systemctl restart systemd-timedated.service
3. 再次查看时区状态
timedatectl
张凯旋 8/29 15:06:44
1. 关闭 NTP 同步
sudo timedatectl set-ntp off
2. 手动设置当前北京时间(示例:2025-08-12 22:15:00)
sudo timedatectl set-time "2025-08-12 22:15:00"
3. 重新开启 NTP 同步(自动校准时间,同时应用时区)
sudo timedatectl set-ntp on
4. 验证时间
date # 应显示 CST 时间,且与网络时间一致