CentOS7时间显示不对问题

2022/8/21 5:23:22

本文主要是介绍CentOS7时间显示不对问题,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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

[[email protected] bin]# date
Sat Aug 20 05:03:38 EDT 2022

[[email protected] bin]# ntpdate ntp1.aliyun.com

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

[[email protected] bin]# hwclock --show
Sat 20 Aug 2022 05:04:25 AM EDT -0.178848 seconds

[[email protected] bin]# date
Sat Aug 20 05:05:53 EDT 2022

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

[[email protected] ~]# 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

[[email protected] ~]# timedatectl set-timezone Asia/Shanghai
[[email protected] ~]# date
Sat Aug 20 17:15:32 CST 2022

 



这篇关于CentOS7时间显示不对问题的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程