CentOS7时间显示不对问题

 今天排查问题的时候查看日志,发现时间不对

[root@centos7-55 bin]# date
Sat Aug 20 05:03:38 EDT 2022

[root@centos7-55 bin]# ntpdate ntp1.aliyun.com

同步一次时间之后再查还是不对

[root@centos7-55 bin]# hwclock --show
Sat 20 Aug 2022 05:04:25 AM EDT -0.178848 seconds

[root@centos7-55 bin]# date
Sat Aug 20 05:05:53 EDT 2022

查看时区,发现是时区设置错误,设置成了纽约时区,应该是装系统的时候忘了设置导致的。

[root@centos7-55 ~]# timedatectl
      Local time: Sat 2022-08-20 05:13:05 EDT
  Universal time: Sat 2022-08-20 09:13:05 UTC
        RTC time: Sat 2022-08-20 09:13:05
       Time zone: America/New_York (EDT, -0400)
     NTP enabled: yes
NTP synchronized: yes
 RTC in local TZ: no
      DST active: yes
 Last DST change: DST began at
                  Sun 2022-03-13 01:59:59 EST
                  Sun 2022-03-13 03:00:00 EDT
 Next DST change: DST ends (the clock jumps one hour backwards) at
                  Sun 2022-11-06 01:59:59 EDT
                  Sun 2022-11-06 01:00:00 EST

 

 重新设置是时区,再查时间OK

[root@centos7-55 ~]# timedatectl set-timezone Asia/Shanghai
[root@centos7-55 ~]# date
Sat Aug 20 17:15:32 CST 2022

 

posted @ 2022-08-20 17:21  北极之光的博客  阅读(1075)  评论(0编辑  收藏  举报