首页 文章

PHP中的Europe / London和UTC之间有区别吗? [关闭]

提问于
浏览
5

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

BST(英国标准时间)是格林尼治标准时间 - 1小时,具体取决于夏令时(夏令时) .

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

1 回答

  • 18

    欧洲/伦敦如何用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
    

相关问题