加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – CentOS忽略时区并显示UTC

发布时间:2020-12-13 16:41:58 所属栏目:Linux 来源:网络整理
导读:我已将服务器的时区设置为Central: /etc/localtime - /usr/share/zoneinfo/US/Central 重新启动后,当我运行date命令时,时间仍以UTC格式列出. [root@dev etc]# dateSat Oct 5 16:14:28 UTC 2013 如何让它在当地时区显示? 解决方法 您可以检查此文件是否有问
我已将服务器的时区设置为Central:
/etc/localtime -> /usr/share/zoneinfo/US/Central

重新启动后,当我运行date命令时,时间仍以UTC格式列出.

[root@dev etc]# date
Sat Oct  5 16:14:28 UTC 2013

如何让它在当地时区显示?

解决方法

您可以检查此文件是否有问题:/ etc / localtime

使用例如:

zdump -v /usr/share/zoneinfo/US/Central or zdump -v /etc/localtime

就我而言,今年的信息如下:

/usr/share/zoneinfo/US/Central  Sun Mar 10 07:59:59 2013 UTC = Sun Mar 10 01:59:59 2013 CST isdst=0 gmtoff=-21600
/usr/share/zoneinfo/US/Central  Sun Mar 10 08:00:00 2013 UTC = Sun Mar 10 03:00:00 2013 CDT isdst=1 gmtoff=-18000
/usr/share/zoneinfo/US/Central  Sun Nov  3 06:59:59 2013 UTC = Sun Nov  3 01:59:59 2013 CDT isdst=1 gmtoff=-18000
/usr/share/zoneinfo/US/Central  Sun Nov  3 07:00:00 2013 UTC = Sun Nov  3 01:00:00 2013 CST isdst=0 gmtoff=-21600

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读