PHP中的欧洲/伦敦和UTC之间有区别吗? [英] Is there a difference between Europe/London and UTC in PHP?

查看:34
本文介绍了PHP中的欧洲/伦敦和UTC之间有区别吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 UTC 和 GMT 实际上是一回事.

I know that UTC and GMT are effectively the same thing.

BST(英国标准时间)为 GMT +- 1 小时,具体取决于 DST(夏令时).

BST (British Standard Time) is GMT +- 1 hour depending on DST (Daylight Saving Time).

考虑到这一点,Europe/London 在 PHP 中是如何解释的?基本上是UTC/GMT吗?

With that in mind, how is Europe/London interpreted in PHP? Is it basically UTC/GMT?

推荐答案

欧洲/伦敦在 PHP 中是如何解释的?基本上是UTC/GMT吗?

how is Europe/London interpreted in PHP? Is it basically UTC/GMT?

它们不一样(UTC/GMT 没有夏令时).在撰写本文时,它们相隔一个小时:

They are not the same (UTC/GMT has no daylight savings). As of this writing they are an hour apart:

$utc = new DateTime('now', new DateTimeZone('UTC'));
echo $utc->format('Y-m-d H:i:s'); // output: 2013-06-03 15:37:08

$el = new DateTime('now', new DateTimeZone('Europe/London'));
echo $el->format('Y-m-d H:i:s'); //  output: 2013-06-03 16:37:08

这篇关于PHP中的欧洲/伦敦和UTC之间有区别吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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