Is there a difference between Europe/London and UTC in PHP? [closed]

守給你的承諾、 提交于 2019-12-06 02:39:34

问题


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

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

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


回答1:


how is Europe/London interpreted in PHP? Is it basically 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


来源:https://stackoverflow.com/questions/16900339/is-there-a-difference-between-europe-london-and-utc-in-php

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