美国/洛杉矶和美国/太平洋时区与PST8PDT之间的时差? [英] Difference between timezones America/Los_Angeles and US/Pacific and PST8PDT?
问题描述
我需要将MySQL数据库中的一堆日期从太平洋时间(America/Los_Angeles)转换为UTC.我找到了关于如何执行此操作的很好的答案.
I need to convert a bunch of dates in a MySQL database from Pacific time (America/Los_Angeles) to UTC. I found a great SO answer on how to do this.
在测试和准备过程中,发现使用以下任何时区名称时,我都获得了相同的时间转换:
During my tests and preparation, I'm finding that I'm getting the same time conversions when using any of the following time zone names:
- 美国/美国洛杉矶
- 美国/太平洋地区
- PST8PDT
所以我的问题如下:
- 这些都是同一事物的别名吗?还是它们在某个时间点之间存在实际差异?
- 如果我想为网站上的用户提供时区列表,是否最好从
America
组名称或US
组名称中为他们提供选择?
- Are these all just aliases to the same thing? Or are there actual differences between them at some point in time?
- If I want to provide a list of timezones to users on a website, would it be better to give them selections from the
America
group of names, or theUS
group of names?
推荐答案
美国/太平洋地区和PST8PDT都属于其他"时区,它带有以下警告:
US/Pacific and PST8PDT both belong to the "other" timezones, which come with this warning:
请不要使用此处列出的任何时区(UTC除外),它们仅出于向后兼容的原因而存在.
它们应该都指向同一时区,请进行比较:
They should all refer to the same timezone, compare:
http://www.travelmath.com/time-zone/PST8PDT
http://www.travelmath.com/time-zone/US/Pacific
http://www.travelmath.com/time-zone/America/Los_Angeles
http://www.travelmath.com/time-zone/PST8PDT
http://www.travelmath.com/time-zone/US/Pacific
http://www.travelmath.com/time-zone/America/Los_Angeles
因此,您应该使用America/Los_Angeles,顺便说一句,这对于用户来说也应该是相当自然"且容易选择的事情.
As such, you should use America/Los_Angeles, which incidentally should also be a pretty "natural" and easy thing to select for users.
这篇关于美国/洛杉矶和美国/太平洋时区与PST8PDT之间的时差?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!