Is UTC_TIMESTAMP() affected by daylight savings?

廉价感情. 提交于 2021-02-04 19:08:21

问题


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.

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

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?


回答1:


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

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



来源:https://stackoverflow.com/questions/17378476/is-utc-timestamp-affected-by-daylight-savings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!