Home  >  Article  >  Backend Development  >  Time zone sharing supported by php

Time zone sharing supported by php

小云云
小云云Original
2018-03-15 11:12:021150browse


What time zones does php7 support? This article mainly shares with you the time zones supported by php, I hope it can help you.

<?php$timeZones = DateTimeZone::listIdentifiers();
// $timeZones = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, &#39;CN&#39;);
// $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'] . "
"); }

Time zone sharing supported by php

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn