gpt4 book ai didi

mysql - UTC_TIMESTAMP() 是否受夏令时影响?

转载 作者:可可西里 更新时间:2023-11-01 08:34:21 25 4
gpt4 key购买 nike

我正在编写一个具有时间段预订系统的应用程序。用户可以处于不同的时区,因此我需要以 UTC 时间将值存储在数据库中。

我想知道 UTC_TIMESTAMP() 在 MySQL 中是如何计算的。靠谱吗?

如果服务器时区位于实行夏令时的区域,UTC_TIMESTAMP() 是否会始终正确运行,即使在由于夏令时导致的时间更改期间也是如此?

最佳答案

UTC 始终是 +0:00 - 它忽略夏令时,无论它是否有效。

在英国,当不使用夏令时时,我们使用 GMT (与 UTC 相同)。当我们观察夏令时时,我们有 BST为此。

Wikipeda 在 UTC 上是这样说的:

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 (summer time). For example, local time on the east coast of the United States is five hours behind UTC during winter, but four hours behind while daylight saving is observed there.

关于mysql - UTC_TIMESTAMP() 是否受夏令时影响?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17378476/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com