src/Stdlib/Util.php
public static function listTimezones() {
        if (self::$timezones === null) {
            self::$timezones = array();
            $offsets = array();
            $now = new DateTime();

            foreach (DateTimeZone::listIdentifiers() as $timezone) {
                $now->setTimezone(new DateTimeZone($timezone));
                $offsets[] = $offset = $now->getOffset();
                self::$timezones[$timezone] = '(' . self::formatGmtOffset($offset) . ') ' . self::formatTimezoneName($timezone);
            }

            array_multisort($offsets, self::$timezones);
        }

        return self::$timezones;
    }
public static function listTimezones() {
        if (self::$timezones === null) {
            self::$timezones = array();
            $offsets = array();
            $now = new DateTime();

            foreach (DateTimeZone::listIdentifiers() as $timezone) {
                $now->setTimezone(new DateTimeZone($timezone));
                $offsets[] = $offset = $now->getOffset();
                self::$timezones[$timezone] = '(' . self::formatGmtOffset($offset) . ') ' . self::formatTimezoneName($timezone);
            }

            array_multisort($offsets, self::$timezones);
        }

        return self::$timezones;
    }
public static function listTimezones ( ) { if ( self :: $ timezones === null ) { self :: $ timezones = array ( ) ; $ offsets = array ( ) ; $ now = new DateTime ( ) ; foreach ( DateTimeZone :: listIdentifiers ( ) as $ timezone ) { $ now -> setTimezone ( new DateTimeZone ( $ timezone ) ) ; $ offsets [ ] = $ offset = $ now -> getOffset ( ) ; self :: $ timezones [ $ timezone ] = '(' . self :: formatGmtOffset ( $ offset ) . ') ' . self :: formatTimezoneName ( $ timezone ) ; } array_multisort ( $ offsets , self :: $ timezones ) ; } return self :: $ timezones ; }
Create a list of time zones
@return array
Create a list of time zones