Home >Backend Development >PHP Tutorial >Time zone sharing supported by php
<?php$timeZones = DateTimeZone::listIdentifiers(); // $timeZones = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, 'CN'); // $timeZones = DateTimeZone::listIdentifiers(DateTimeZone::AFRICA | DateTimeZone::AMERICA);echo "<pre class="brush:php;toolbar:false">"; print_r($timeZones);echo "";exit;foreach ($timeZones as $key => $zoneName) { $tz = new DateTimeZone($zoneName); $loc = $tz->getLocation(); print($zoneName . " = " . $loc['comments'] . "
Related recommendations:
Time zone instance sharing supported by php
The above is the detailed content of Time zone sharing supported by php. For more information, please follow other related articles on the PHP Chinese website!