2 Test timezone_transitions_get() function : basic functionality
5 /* Prototype : array timezone_transitions_get ( DateTimeZone $object, [ int $timestamp_begin [, int $timestamp_end ]] )
6 * Description: Returns all transitions for the timezone
7 * Source code: ext/date/php_date.c
8 * Alias to functions: DateTimeZone::getTransitions()
11 echo "*** Testing timezone_transitions_get() : basic functionality ***\n";
13 //Set the default time zone
14 date_default_timezone_set("Europe/London");
16 // Create a DateTimeZone object
17 $tz = timezone_open("Europe/London");
19 $tran = timezone_transitions_get($tz);
21 echo "\n-- Get all transitions --\n";
22 $tran = timezone_transitions_get($tz);
23 var_dump( gettype($tran) );
25 echo "\n-- Total number of transitions: " . count($tran). " --\n";
27 echo "\n-- Format a sample entry pfor Spring 1963 --\n";
28 var_dump( $tran[97] );
33 *** Testing timezone_transitions_get() : basic functionality ***
35 -- Get all transitions --
38 -- Total number of transitions: 243 --
40 -- Format a sample entry pfor Spring 1963 --
45 string(24) "1963-03-31T02:00:00+0000"