public static function timeZones()
    {
        $timeZones = [];

        $timezone_identifiers = DateTimeZone::listIdentifiers();
        sort($timezone_identifiers);

        $timeZones['UTC'] = Yii::t('podium/view', 'default (UTC)');

        foreach ($timezone_identifiers as $zone) {
            if ($zone != 'UTC') {
                $zoneName = $zone;
                $timeForZone = new DateTime(null, new DateTimeZone($zone));
                $offset = $timeForZone->getOffset();
                if (is_numeric($offset)) {
                    $zoneName .= ' (UTC';
                    if ($offset != 0) {
                        $offset = $offset / 60 / 60;
                        $offsetDisplay = floor($offset) . ':' . str_pad(60 * ($offset - floor($offset)), 2, '0', STR_PAD_LEFT);
                        $zoneName .= ' ' . ($offset < 0 ? '' : '+') . $offsetDisplay;
                    }
                    $zoneName .= ')';
                }
                $timeZones[$zone] = $zoneName;
            }
        }

        return $timeZones;
    }
public static function timeZones()
    {
        $timeZones = [];

        $timezone_identifiers = DateTimeZone::listIdentifiers();
        sort($timezone_identifiers);

        $timeZones['UTC'] = Yii::t('podium/view', 'default (UTC)');

        foreach ($timezone_identifiers as $zone) {
            if ($zone != 'UTC') {
                $zoneName = $zone;
                $timeForZone = new DateTime(null, new DateTimeZone($zone));
                $offset = $timeForZone->getOffset();
                if (is_numeric($offset)) {
                    $zoneName .= ' (UTC';
                    if ($offset != 0) {
                        $offset = $offset / 60 / 60;
                        $offsetDisplay = floor($offset) . ':' . str_pad(60 * ($offset - floor($offset)), 2, '0', STR_PAD_LEFT);
                        $zoneName .= ' ' . ($offset < 0 ? '' : '+') . $offsetDisplay;
                    }
                    $zoneName .= ')';
                }
                $timeZones[$zone] = $zoneName;
            }
        }

        return $timeZones;
    }
public static function timeZones ( ) { $ timeZones = [ ] ; $ timezone_identifiers = DateTimeZone :: listIdentifiers ( ) ; sort ( $ timezone_identifiers ) ; $ timeZones [ 'UTC' ] = Yii :: t ( 'podium/view' , 'default (UTC)' ) ; foreach ( $ timezone_identifiers as $ zone ) { if ( $ zone != 'UTC' ) { $ zoneName = $ zone ; $ timeForZone = new DateTime ( null , new DateTimeZone ( $ zone ) ) ; $ offset = $ timeForZone -> getOffset ( ) ; if ( is_numeric ( $ offset ) ) { $ zoneName .= ' (UTC' ; if ( $ offset != 0 ) { $ offset = $ offset / 60 / 60 ; $ offsetDisplay = floor ( $ offset ) . ':' . str_pad ( 60 * ( $ offset - floor ( $ offset ) ) , 2 , '0' , STR_PAD_LEFT ) ; $ zoneName .= ' ' . ( $ offset < 0 ? '' : '+' ) . $ offsetDisplay ; } $ zoneName .= ')' ; } $ timeZones [ $ zone ] = $ zoneName ; } } return $ timeZones ; }
Returns time zones with current offset array.
@return array
Returns time zones with current offset array .