classes/Events/API/Util.php
public static function getTimezoneInfo($tz_id) {

		$tz = new \DateTimeZone($tz_id);
		$location = $tz->getLocation();
		$country_code = $location['country_code'];

		$dt = new DateTime(null, $tz);

		$region = explode('/', $tz_id);
		if (sizeof($region) > 1) {
			array_shift($region);
		}
		$region = str_replace('_', ' ', implode(', ', $region));

		$tzinfo = new stdClass();
		$tzinfo->id = $tz_id;
		$tzinfo->abbr = $dt->format('T');
		$tzinfo->country_code = $country_code;
		$tzinfo->country = elgg_echo("timezone:country:$country_code");
		$tzinfo->region = $region;
		$tzinfo->offset = $dt->getOffset();
		$tzinfo->gmt = $dt->format('\(\G\M\TP\)');

		$name = "timezone:name:$tzinfo->country_code:$tzinfo->abbr";
		$name_tr = elgg_echo($name);
		$tzinfo->name = ($name == $name_tr) ? $tzinfo->abbr : $name_tr;
		$tzinfo->label = "$tzinfo->gmt $tzinfo->name - $tzinfo->region";

		return $tzinfo;
	}
public static function getTimezoneInfo($tz_id) {

		$tz = new \DateTimeZone($tz_id);
		$location = $tz->getLocation();
		$country_code = $location['country_code'];

		$dt = new DateTime(null, $tz);

		$region = explode('/', $tz_id);
		if (sizeof($region) > 1) {
			array_shift($region);
		}
		$region = str_replace('_', ' ', implode(', ', $region));

		$tzinfo = new stdClass();
		$tzinfo->id = $tz_id;
		$tzinfo->abbr = $dt->format('T');
		$tzinfo->country_code = $country_code;
		$tzinfo->country = elgg_echo("timezone:country:$country_code");
		$tzinfo->region = $region;
		$tzinfo->offset = $dt->getOffset();
		$tzinfo->gmt = $dt->format('\(\G\M\TP\)');

		$name = "timezone:name:$tzinfo->country_code:$tzinfo->abbr";
		$name_tr = elgg_echo($name);
		$tzinfo->name = ($name == $name_tr) ? $tzinfo->abbr : $name_tr;
		$tzinfo->label = "$tzinfo->gmt $tzinfo->name - $tzinfo->region";

		return $tzinfo;
	}
public static function getTimezoneInfo ( $ tz_id ) { $ tz = new \ DateTimeZone ( $ tz_id ) ; $ location = $ tz -> getLocation ( ) ; $ country_code = $ location [ 'country_code' ] ; $ dt = new DateTime ( null , $ tz ) ; $ region = explode ( '/' , $ tz_id ) ; if ( sizeof ( $ region ) > 1 ) { array_shift ( $ region ) ; } $ region = str_replace ( '_' , ' ' , implode ( ', ' , $ region ) ) ; $ tzinfo = new stdClass ( ) ; $ tzinfo -> id = $ tz_id ; $ tzinfo -> abbr = $ dt -> format ( 'T' ) ; $ tzinfo -> country_code = $ country_code ; $ tzinfo -> country = elgg_echo ( "timezone:country:$country_code" ) ; $ tzinfo -> region = $ region ; $ tzinfo -> offset = $ dt -> getOffset ( ) ; $ tzinfo -> gmt = $ dt -> format ( '\(\G\M\TP\)' ) ; $ name = "timezone:name:$tzinfo->country_code:$tzinfo->abbr" ; $ name_tr = elgg_echo ( $ name ) ; $ tzinfo -> name = ( $ name == $ name_tr ) ? $ tzinfo -> abbr : $ name_tr ; $ tzinfo -> label = "$tzinfo->gmt $tzinfo->name - $tzinfo->region" ; return $ tzinfo ; }
Expands timezone ID into a usable source of data about the timezone

@param string $tz_id Timezone ID e.g. America\New_York
@return stdClass
Expands timezone ID into a usable source of data about the timezone