UTC_TIMESTAMP() 是否受夏令时的影响? [英] Is UTC_TIMESTAMP() affected by daylight savings?

查看:46
本文介绍了UTC_TIMESTAMP() 是否受夏令时的影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am writing an app that has a time slot booking system. The users can be in different timezones, thus I need to store the values in the database in UTC time.

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

I was wondering how UTC_TIMESTAMP() is calculated in MySQL. Is it reliable?

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

If the server timezone is in an area with daylight savings will UTC_TIMESTAMP() always behave correctly, even during time changes due to daylight savings?

推荐答案

UTC 总是 +0:00 - 它忽略夏令时,不管它是否生效.

UTC is always +0:00 - it ignores daylight savings, regardless of whether or not it is in effect.

在英国,如果不是夏令时,我们使用 GMT(这与如UTC).当我们遵守夏令时,我们有BST.

In the UK, when not on daylight savings, we use GMT (which is the same as UTC). When we're observing daylight savings, we have BST for that.

Wikipeda 在 UTC 上有这样的说法:

Wikipeda has this to say on 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 (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.

这篇关于UTC_TIMESTAMP() 是否受夏令时的影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆