将日期转换为GMT和UTC。

huangapple go评论55阅读模式
英文:

Convert date to GMT and UTC

问题

如果我有日期:2023-07-25 18:00:00 在GMT-4时区,那么在GMT和UTC时区中对应的日期是多少呢?

我不知道是否我感到困惑,但GMT和UTC不是相同的,这是否意味着我要给日期加4小时?

英文:

Could you give me a hand, I have the following confusion: If I have the date: 2023-07-25 18:00:00 in GMT-4, what would be the corresponding date in GMT and UTC?

I don't know if I'm confused but GMT and UTC are not the same, does that mean that I add 4 hours to the date?

答案1

得分: 2

由于原始时间比协调世界时 (UTC) 慢 4 小时,所以是的 - 你需要上四个小时来得到UTC时间。

换句话说,使用ISO 8601 / RFC 3339 标准表示法:2023-07-25T18:00:00-04:00 等同于 2023-07-25T22:00:00Z

关于GMT和UTC - 在现代用法中,它们在逻辑上是相同的 - 当前的GMT时间和当前的UTC时间具有相同的值。当人们说GMT和UTC不同的时候,他们指的是它们指向不同的概念

  • UTC是协调世界时。它是世界上所有其他时钟同步的时钟,并提供了时区偏移和夏令时规则应用到本地时间的基准。

  • GMT是格林威治平均时间。在现代用法中,它仅仅是指英国格林威治的时间,不考虑夏令时(即不考虑英国夏令时)。在过去,在UTC的正式定义之前,它也曾是时间同步的基础,但这一角色已经被UTC取代。

另一种思考方式是UTC有一个技术定义,而GMT有一个仅适用于英国的立法定义。

英文:

Since the original time is 4 hours behind UTC, then yes - you would add four hours to get the UTC time.

In other words, using ISO 8601 / RFC 3339 standard notation: 2023-07-25T18:00:00-04:00 is equivalent to 2023-07-25T22:00:00Z.

With regard to GMT and UTC - they are logically the same in modern usage - in that the current GMT time and current UTC time have the same values. When people say that GMT and UTC are not they same, they mean that that they refer to different concepts:

  • UTC is Coordinated Universal Time. It is the clock that the world synchronizes all other clocks to, and provides the baseline that time zone offsets and DST rules are applied to become local time.

  • GMT is Greenwich Mean Time. In modern usage, it is simply the time in Greenwich, England, UK without regard to daylight saving time (i.e., without British Summer Time). In the past, before the formal definition of UTC, it was also the basis for time synchronization - but that role has since been supplanted by UTC.

Another way to think about it is that UTC has a technical definition, whereas GMT has a legislative definition that only applies in the United Kingdom.

huangapple
  • 本文由 发表于 2023年7月28日 00:56:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/76781946.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定