<分区>
我知道 UTC 和 GMT 实际上是一回事。
BST(英国标准时间)是 GMT +- 1 小时,具体取决于 DST(夏令时)。
考虑到这一点,Europe/London 在 PHP 中是如何解释的?它基本上是 UTC/GMT 吗?
<分区>
我知道 UTC 和 GMT 实际上是一回事。
BST(英国标准时间)是 GMT +- 1 小时,具体取决于 DST(夏令时)。
考虑到这一点,Europe/London 在 PHP 中是如何解释的?它基本上是 UTC/GMT 吗?
最佳答案
how is Europe/London interpreted in PHP? Is it basically UTC/GMT?
它们不一样(UTC/GMT 没有夏令时)。在撰写本文时,它们相隔一个小时:
$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 - PHP 中的 Europe/London 和 UTC 之间有区别吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16900339/