找回密码
 register
搜索
查看: 50|回复: 0

洱海月 Ubuntu 同步北京时间教程

[复制链接]
  • 打卡等级:本地老炮
  • 打卡总天数:533
  • 打卡月天数:22
  • 打卡总奖励:530
  • 最近打卡:2026-06-24 01:45:59
Waylee 发表于 2026-3-18 19:01 | 显示全部楼层 |阅读模式 | Google Chrome | Windows 10

马上注册,查看网站隐藏内容!!

您需要 登录 才可以下载或查看,没有账号?register

×

Ubuntu 同步北京时间教程

  1. 设置时区为北京时间
sudo timedatectl set-timezone Asia/Shanghai
  1. 开启自动同步时间
sudo timedatectl set-ntp true
  1. 重启时间同步服务
sudo systemctl restart systemd-timesyncd
  1. 检查同步状态
timedatectl
  1. 用 24 小时制查看当前时间
date "+%Y-%m-%d %H:%M:%S %Z"

判断是否成功,重点看这几项:

Time zone: Asia/Shanghai (CST, +0800)
System clock synchronized: yes
NTP service: active

一键执行:

sudo timedatectl set-timezone Asia/Shanghai
sudo timedatectl set-ntp true
sudo systemctl restart systemd-timesyncd
timedatectl
date "+%Y-%m-%d %H:%M:%S %Z"
  1. 强制手动修改服务器时间

先关闭自动同步:

sudo timedatectl set-ntp false

再强制设置时间:

sudo timedatectl set-time "2026-03-26 12:34:56"
您需要登录后才可以回帖 登录 | register

本版积分规则

QQ|雪舞知识库 ( 浙ICP备15015590号-1 | 萌ICP备20232229号|浙公网安备33048102000118号 )|天天打卡

GMT+8, 2026-6-24 06:38 , Processed in 0.059143 second(s), 26 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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