我希望这有帮助:
function get_timezone_abbreviation($timezone_id)
{
if($timezone_id){
$abb_list = timezone_abbreviations_list();
$abb_array = array();
foreach ($abb_list as $abb_key => $abb_val) {
foreach ($abb_val as $key => $value) {
$value['abb'] = $abb_key;
array_push($abb_array, $value);
}
}
foreach ($abb_array as $key => $value) {
if($value['timezone_id'] == $timezone_id){
return strtoupper($value['abb']);
}
}
}
return FALSE;
}
get_timezone_abbreviation( ‘美国/纽约’);
你得到:
美东时间