Date/Time 函数
在线手册:中文 英文
PHP手册

timezone_transitions_get

(PHP 5 >= 5.2.0)

timezone_transitions_get别名 DateTimeZone::getTransitions()

说明

此函数是该函数的别名: DateTimeZone::getTransitions()


Date/Time 函数
在线手册:中文 英文
PHP手册
PHP手册 - N: 别名 DateTimeZone::getTransitions

用户评论:

gopalv at php dot net (19-Jun-2007 09:10)

From Derick's talk (http://talks.php.net/show/time-ffm2006/28)

<?php
$tz
= new DateTimeZone("PST");

foreach (
timezone_transitions_get($tz) as $tr)
    if (
$tr['ts'] > time())
        break;

$d = new DateTime( "@{$tr['ts']}" );
printf("The timezone %s switches to %s on %s.<br/>The new GMT offset will be: %d (%s)\n",
   
$tz->getName(), $tr['isdst'] ? "DST" : "standard time",
   
$d->format('d M Y @ H:i'), $tr['offset'], $tr['abbr']
);
?>