本文介绍了EST5EDT 等于 ET 吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 ET(东部时间)有来自 EST 和 EDT 的 DST,但我在不同编程语言的不同库中寻找那个时区,ET 不是一个选项,但 EST5EDT 是.

I know that ET (Eastern Time) has the DST from EST and EDT, but im looking for that timezone in different libraries of different programming languages and ET is not an option, but EST5EDT is.

谢谢.

推荐答案

简短回答:不,它们不相等,因为 EST5EDT 没有任何更改历史记录美国东部时间已经过去了.改用 America/New_York,确实如此.

Short answer: No, They are not equal because EST5EDT doesn't have any history of changes that US Eastern Time has been through. Use America/New_York instead, which does.

更长的答案:

EST5EDT 是一个 POSIX 时区定义,可以在许多系统的 TZ 环境变量中使用.这种格式在 Linux man tz 中有描述GNU 文档,以及 这篇来自 IBM 的文章.EST5EDT 告诉您的只是标准时间是 UTC-5 并标记为 EST,而夏令时是 UTC-4 并标记为 EDT.就是这样.

EST5EDT is a POSIX time zone definition which can be used in a TZ environment variable on many systems. This format is described in the Linux man tz, and in the GNU docs, as well as this article from IBM. All that EST5EDT tells you is that standard time is UTC-5 and labeled EST, and daylight time is UTC-4 and labeled EDT. That's it.

随着计算机系统的发展,很明显 POSIX 时区没有包含足够的信息来正确跟踪世界时区.例如,考虑美国夏令时的历史,其中最后一次更改发生在2007 年,将白天时间延长 5 周.POSIX 定义无法表示此类数据,从而导致转换错误.

As computer systems evolved over time, it became apparent that POSIX time zones don't contain enough information to properly track time zones of the world. For example, consider the history of DST in the United States, of which the last change occurred in 2007, extending the daylight period by 5 weeks. POSIX definitions cannot represent such data, leading to errors in conversions.

因此,现在首选的机制是使用来自 IANA TZ 数据库的时区标识符取而代之(也称为Olson"或ZoneInfo").在此数据库中,美国东部时间由标识符 America/New_York 表示.它还有一个别名 US/Eastern,您可以在大多数库(JavaScript、Python 等)中使用.您可以在此处找到完整的标识符列表.

Thus, now the preferred mechanism is to use time zone identifiers from the IANA TZ Database instead (also called "Olson" or "ZoneInfo"). In this database, US Eastern Time is represented by the identifier America/New_York. It also has an alias of US/Eastern, and you can use either in most libraries (JavaScript, Python, etc.). You can find a complete list of identifiers here.

您可能会注意到 EST5EDT 作为标识符之一出现,EST 也是如此,但不是 EDT.这些都是历史的产物,因为在某个时期,TZ 数据库中的某些标识符需要向后兼容 POSIX 时区定义.您现在应该考虑弃用这些,并且只使用 Area/Locality 形式的标识符.

You may notice that EST5EDT appears as one of the identifiers, as does EST, but not EDT. These are artifacts of history, due to a period where certain identifiers in the TZ database needed to be backwards compatible with POSIX time zone definitions. You should consider these deprecated now, and only use the Area/Locality forms of identifiers.

这篇关于EST5EDT 等于 ET 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 10:34