时区偏离纽约/欧洲?

时间:2014-04-02 12:06:31

标签: php timezone-offset

为什么纽约与以下代码的UTC相差10小时?

这是我的查询:

    $my_timezone = new DateTimeZone("Europe/London");
    $server_timezone = new DateTimeZone("America/New_York");

    $my_date = new DateTime("now", $my_timezone);
    $server_date = new DateTime("now", $server_timezone);

    $my_offset = $my_timezone->getOffset($my_date);
    $server_offset = $server_timezone->getOffset($server_date);

    echo "[my: $my_offset][srv: $server_offset]"; 

0 个答案:

没有答案