Sharing of time zone examples supported by php

小云云
Release: 2023-03-20 14:56:02
Original
1332 people have browsed it


What time zones does php7 support? This article mainly shares with you the time zone examples supported by PHP, hoping to help you understand these time zones.

All time zones supported by php7:

<?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 "
Copy after login
";exit;foreach ($timeZones as $key => $zoneName) { $tz = new DateTimeZone($zoneName); $loc = $tz->getLocation(); print($zoneName . " = " . $loc['comments'] . "
"); }

Sharing of time zone examples supported by php

Related recommendations:

php outputs a list of all time zones

Use PHP to set the system time zone

Summary of how to set the time zone in PHP

The above is the detailed content of Sharing of time zone examples supported by php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!