ubuntu系统时间不正确怎么解决

常见问题

ubuntu系统时间不正确怎么解决

2024-10-15 15:31


ubuntu系统时间不正确的解决方法

                                            




1、系统时间查看

输入:date

输出:2024年 06月 05日 星期三 09:21:47 +06

备注:比电脑时间慢了两个小时;

2、查看系统时区

输入:timedatectl

输出:

Local time: 三 2024-06-05 09:23:44 +06

Universal time: 三 2024-06-05 03:23:44 UTC

RTC time: 三 2024-06-05 03:23:44

Time zone: Asia/Urumqi (+06, +0600)

Network time on: yes

NTP synchronized: yes

RTC in local TZ: no

备注:由输出可知,时区是Asia/Urumqi,时区不对;

3、修改系统时区

输入:sudo timedatectl set-timezone Asia/Shanghai

输出:无

4、再次查看系统时区

输入:timedatectl

输出:

Local time: 三 2024-06-05 11:25:44 CST

Universal time: 三 2024-06-05 03:25:44 UTC

RTC time: 三 2024-06-05 03:25:44

Time zone: Asia/Shanghai (CST, +0800)

Network time on: yes

NTP synchronized: yes

RTC in local TZ: no

备注:由输出可知,时区修改为Asia/Shanghai;

5、安装ntpdate

输入:sudo apt-get install ntpdate

6、同步时间

输入:sudo ntpdate cn.pool.ntp.org

7、再次查看系统时间

输入:date

输出:2024年 06月 05日 星期三 11:26:19 CST

莱卡云服务器,即开即用、价格低至25元/月。 点击了解更


标签:
  • ubuntu
  • linux
  • 云服务器
  • 服务器