pdt时区 mysql数据库,美国/洛杉矶和美国/太平洋时区与PST8PDT之间的时差?

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:

America/Los_Angeles

US/Pacific

PST8PDT

So my questions are the following:

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 the US group of names?

解决方案

US/Pacific and PST8PDT both belong to the "other" timezones, which come with this warning:

Please do not use any of the timezones listed here (besides UTC), they only exist for backward compatible reasons.

They should all refer to the same timezone, compare:

As such, you should use America/Los_Angeles, which incidentally should also be a pretty "natural" and easy thing to select for users.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值