PHP | timezone_transitions_get() Function Last Updated : 17 Sep, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report The timezone_transitions_get() function is an inbuilt function in PHP which is used to returns all transitions for the timezone. This function returns an array containing associative array of all transitions on success or False on failure. Syntax: Procedural style: timezone_transitions_get( $object, $timestamp_begin, $timestamp_end ) Object oriented style: DateTimeZone::getTransitions( $timestamp_begin, $timestamp_end ) Parameters: This function accepts three parameters as mentioned above and described below: $object: It is a mandatory parameter which is used to specify the DateTime object which is returned by the date_create() function. $timestamp_begin: This parameter is used to set begin timestamp. $timestamp_end: This parameter is used to set end timestamp. Return Value: This function returns an array containing associative array with all transitions on success or False on failure. Below programs illustrate the timezone_transitions_get() function in PHP: Program 1: php <?php // Set time_zone object $time_zone = timezone_open('Asia/Kolkata'); // Set the transition of time_zone $transition = timezone_transitions_get( $time_zone ); // Display an array containing associative // array of all transition print_r(array_slice($transition, 0, 3)); ?> Output: Array ( [0] => Array ( [ts] => -9223372036854775808 [time] => -292277022657-01-27T08:29:52+0000 [offset] => 21200 [isdst] => [abbr] => HMT ) [1] => Array ( [ts] => -2147483648 [time] => 1901-12-13T20:45:52+0000 [offset] => 19270 [isdst] => [abbr] => MMT ) [2] => Array ( [ts] => -2019705670 [time] => 1905-12-31T18:38:50+0000 [offset] => 19800 [isdst] => [abbr] => IST ) ) Program 2: php <?php // Set time_zone object $timezone = new DateTimeZone("Asia/Kolkata"); // Set the transition of time_zone $transition = $timezone->getTransitions(); // Display an array containing associative // array of all transition print_r(array_slice($transition, 0, 3)); ?> Output: Array ( [0] => Array ( [ts] => -9223372036854775808 [time] => -292277022657-01-27T08:29:52+0000 [offset] => 21200 [isdst] => [abbr] => HMT ) [1] => Array ( [ts] => -2147483648 [time] => 1901-12-13T20:45:52+0000 [offset] => 19270 [isdst] => [abbr] => MMT ) [2] => Array ( [ts] => -2019705670 [time] => 1905-12-31T18:38:50+0000 [offset] => 19800 [isdst] => [abbr] => IST ) ) Related Articles: PHP | timezone_offset_get() Function PHP | timezone_name_get() Function Reference: http://php.net/manual/en/datetimezone.gettransitions.php Comment More infoAdvertise with us Next Article PHP | date_timezone_get() Function V vijay_raj Follow Improve Article Tags : Misc Web Technologies PHP PHP-date-time PHP-function +1 More Practice Tags : Misc Similar Reads PHP | timezone_version_get() Function The timezone_version_get() function is an inbuilt function in PHP which is used to return the version of the timezone database. No parameters are required to be passed in the timezone_version_get() function. Syntax: string timezone_version_get() Parameters: The timezone_version_get() function does n 1 min read PHP | timezone_name_get() Function The timezone_name_get() function is an inbuilt function in PHP which is used to return the name of the timezone. The date time object is sent as a parameter to the timezone_name_get() function and it returns the name of the timezone on success or False on failure. Syntax: string timezone_name_get( $ 2 min read PHP | date_timezone_get() Function The date_timezone_get() function is an inbuilt function in PHP which is used to return time zone relative to given DateTime. This function returns a DateTimeZone object on success or False on failure. Syntax: Procedural style: date_timezone_get( $object ) Object oriented style: DateTime::getTimezone 1 min read PHP | timezone_open() Function The timezone_open() function is an inbuilt function in PHP which is used to create a new DateTimeZone object. The timezone_open() function accepts the timezone as a parameter and returns the DateTimeZone object on success or False on failure. Syntax: timezone_open( $timezone ) Parameters: This funct 2 min read PHP | timezone_offset_get() Function The timezone_offset_get() function is an inbuilt function in PHP which is used to return the timezone offset from GMT. The date time object and the date-time are sent as a parameter to the timezone_offset_get() function and return the timezone offset in seconds on success or False on failure. Syntax 2 min read PHP | timezone_location_get() Function The timezone_location_get() function is an inbuilt function in PHP which is used to return the location information for the given timezone. The date time object is sent as a parameter to the timezone_location_get() function and it returns location information related to the timezone on success or Fa 2 min read Like