array timezone_abbreviations_list ( void ); array DateTimeZone::listAbbreviations ( void );
这些函数返回包含DST、偏移量和时区名称的关联数组。
上述两个函数是等效的,并且可以使用任何函数,如下例所示。
如果成功,则返回数组;如果失败,则返回False。
<?php $timezone_abbreviations=timezone_abbreviations_list (); print_r($timezone_abbreviations["acst"]); echo "----------------------------------------------\n"; # Using second function. $timezone_abbreviations=DateTimeZone::listAbbreviations(); print_r($timezone_abbreviations["acst"]); ?>
这将产生以下输出-
Array ( [0] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Porto_Acre ) [1] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Eirunepe ) [2] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Rio_Branco ) [3] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => Brazil/Acre ) ) ------------------------------------------------------ Array ( [0] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Porto_Acre ) [1] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Eirunepe ) [2] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => America/Rio_Branco ) [3] => Array ( [dst] => 1 [offset] => -14400 [timezone_id] => Brazil/Acre ) )
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)
Spring Boot与Kubernetes云原生微服务实践 -〔杨波〕