【问题标题】:Is there a difference between Europe/London and UTC in PHP? [closed]PHP中的欧洲/伦敦和UTC之间有区别吗? [关闭]
【发布时间】:2013-05-29 19:35:37
【问题描述】:

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

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

考虑到这一点,如何用 PHP 解释欧洲/伦敦?基本上是 UTC/GMT 吗?

【问题讨论】:

    标签: php time timezone utc


    【解决方案1】:

    如何用 PHP 解释欧洲/伦敦?基本上是 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-01
      相关资源
      最近更新 更多