Quantcast
Channel: PHP Timezone List - Stack Overflow
Viewing all articles
Browse latest Browse all 15

Answer by Diego Favero for PHP Timezone List

$
0
0

from @chpx 's answer:

function getAllTimeZones(){$selectOptions = "";    foreach(\DateTimeZone::listIdentifiers() as  $zoneLabel)    {        $currentTimeInZone = new \DateTime("now", new \DateTimeZone($zoneLabel));        $currentTimeDiff = $currentTimeInZone->format('P');        $selectOptions .= "<option value=\"$zoneLabel\">(GMT $currentTimeDiff) $zoneLabel</option>\n";    }return $selectOptions;}

Viewing all articles
Browse latest Browse all 15

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>