UTC是否遵守夏令时?

编程入门 行业动态 更新时间:2024-10-25 14:33:54
本文介绍了UTC是否遵守夏令时?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试编写一个脚本,在该脚本中我想将任何时区转换为UTC并反转. 但是从某些地方我知道,在考虑或不考虑DST的情况下将任何时区转换为UTC时,都会给出相同的UTC时间. 例如: 如果我尝试将其转换为一个:

I am trying to write a script where i want to convert any timezone to UTC and reverse. But from some where i came to know that while converting any timezone to UTC with or without DST consideration it will give the same UTC time. For example: If i try to convert this one:

$mytime = '2011-03-31 05:06:00.000'; $myzone = 'America/New_York';

使用DST而不使用DST的UTC,我将获得..

to UTC with DST and without DST,i will get ..

(New_York->UTC DST=Yes)2011-03-31 09:06:00 (New_York->UTC DST=No)2011-03-31 09:06:00 ..........

这是核心吗?如果是,那么为什么??? 请任何人给我您的答案.

Is this corect ??If yes then why??? Please anybody give me your answers.

推荐答案

不,UTC本身从来没有DST.这是相对于其他时区表示的恒定参考框架.

No, UTC itself never has DST. It is the constant frame of reference other time zones are expressed relative to.

在 Wikipedia UTC页面中:

UTC不会随季节的变化而变化,但是如果时区所在区域遵守夏令时或夏令时,则当地时间或民用时间可能会发生变化.例如,冬季时UTC比美国东海岸的当地时间早5小时,而夏季则比当地时间早4小时.

UTC does not change with a change of seasons, but local time or civil time may change if a time zone jurisdiction observes daylight saving time or summer time. For example, UTC is 5 hours ahead of local time on the east coast of the United States during winter, but 4 hours ahead during summer.

换句话说,当某个时区观察到DST时,它与UTC的偏移量会在DST转换时发生变化,但这就是该时区观察DST而不是UTC的时间.

In other words, when a time zone observes DST, its offset from UTC changes when there's a DST transition, but that's that time zone observing DST, not UTC.

在不了解PHP时区处理的情况下,让我感到奇怪的是,您可以在转换中指定"with DST"或"without DST"-时区本身指定何时启动DST ...这不应该必须是您自己指定的东西.

Without knowing much about PHP time zone handling, it seems strange to me that you can specify "with DST" or "without DST" in a conversion - the time zones themselves specify when DST kicks in... it shouldn't have to be something you specify yourself.

更多推荐

UTC是否遵守夏令时?

本文发布于:2023-10-28 08:24:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1536084.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:夏令时   UTC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!