扫码一下
查看教程更方便
timezone_transitions_get - 返回时区的所有转换。
timezone_transitions_get ( DateTimeZone $object [, int $timestamp_begin = PHP_INT_MIN [, int $timestamp_end = PHP_INT_MAX ]] )
参数 | 是否必须 | 描述 |
---|---|---|
object | 是 | 由 timezone_open() 返回的 DateTimeZone 对象。 |
timestamp_begin | 否 | 开始时间戳。 |
timestamp_end | 否 | 结束时间戳。 |
<?php
$timezone = new DateTimeZone("Europe/London");
$transitions = $timezone->getTransitions();
print_r(array_slice($transitions, 0, 3));
?>
执行结果:
Array
(
[0] => Array
(
[ts] => -9223372036854775808
[time] => -292277022657-01-27T08:29:52+0000
[offset] => -75
[isdst] =>
[abbr] => LMT
)
[1] => Array
(
[ts] => -3852662325
[time] => 1847-12-01T00:01:15+0000
[offset] => 0
[isdst] =>
[abbr] => GMT
)
[2] => Array
(
[ts] => -1691964000
[time] => 1916-05-21T02:00:00+0000
[offset] => 3600
[isdst] => 1
[abbr] => BST
)
)