自动调整夏令时 linux,Linux夏令时是怎么调整的?

以法国巴黎为例:

root@121 zoneinfo]# ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime

[root@121 zoneinfo]# date

2015年 10月 13日 星期二 03:45:09 CEST

[root@121 zoneinfo]# date -R

Tue, 13 Oct 2015 03:45:31 +0200

[root@121 zoneinfo]# zdump -v /etc/localtime | grep 2015

/etc/localtime Sun Mar 29 00:59:59 2015 UTC = Sun Mar 29 01:59:59 2015 CET isdst=0 gmtoff=3600

/etc/localtime Sun Mar 29 01:00:00 2015 UTC = Sun Mar 29 03:00:00 2015 CEST isdst=1 gmtoff=7200

/etc/localtime Sun Oct 25 00:59:59 2015 UTC = Sun Oct 25 02:59:59 2015 CEST isdst=1 gmtoff=7200

/etc/localtime Sun Oct 25 01:00:00 2015 UTC = Sun Oct 25 02:00:00 2015 CET isdst=0 gmtoff=3600

[root@121 zoneinfo]# date -s "2015-10-25 02:59:50"

2015年 10月 25日 星期日 02:59:50 CET

[root@121 zoneinfo]# date -R

Tue, 13 Oct 2015 03:47:16 +0200

[root@121 zoneinfo]# date

2015年 10月 13日 星期二 03:58:32 CEST

从dump的信息可以看出,当巴黎时间到“2015-10-25 02:59:59”的时候,应该跳出夏令时。即从CEST时区调整至CET时区,时间回调一个小时。

但在将时间调整到“2015-10-25 02:59:50”测试的时候,就已经切换到了CET时区。

但是纽约时间就是正常的:

[root@121 zoneinfo]# ll /etc/localtime

lrwxrwxrwx 1 root root 36 10月 12 21:59 /etc/localtime -> /usr/share/zoneinfo/America/New_York

[root@121 zoneinfo]# zdump -v /etc/localtime | grep 2015

/etc/localtime Sun Mar 8 06:59:59 2015 UTC = Sun Mar 8 01:59:59 2015 EST isdst=0 gmtoff=-18000

/etc/localtime Sun Mar 8 07:00:00 2015 UTC = Sun Mar 8 03:00:00 2015 EDT isdst=1 gmtoff=-14400

/etc/localtime Sun Nov 1 05:59:59 2015 UTC = Sun Nov 1 01:59:59 2015 EDT isdst=1 gmtoff=-14400

/etc/localtime Sun Nov 1 06:00:00 2015 UTC = Sun Nov 1 01:00:00 2015 EST isdst=0 gmtoff=-18000

[root@121 zoneinfo]# date -s "2015-11-01 01:59:50"

2015年 11月 01日 星期日 01:59:50 EDT

[root@121 zoneinfo]# date

2015年 11月 01日 星期日 01:00:07 EST

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值