Return java available timezone ids.

@return array
551418
public function getAvailableIDs(): array
    {
        if ($this->availableTz === null) {
            $this->availableTz = [];
            $available = $this->timeZoneClass->getAvailableIDs();
            foreach ($available as $id) {
                $this->availableTz[] = $id;
            }
        }

        return $this->availableTz;
    }
1177470
public function getAvailableTimesets()
    {
        // build array with localized names
        if (!isset(self::$timesetNames)) {
            self::$timesetNames = [
                $this->translator->_('standard_time'),
                $this->translator->_('swatch_time'),
                $this->translator->_('iso_time'),
            ];
        }

        // return the names of the timesets
        return self::$timesetNames;
    }
1022021
public static function timezone()
    {
        if (!self::isDebug()) {
            return false;
        }

        $data = date_default_timezone_get();
        return self::i()->dump($data, '! timezone !');
    }
989675
private static function getTimezones(int $regions, string $input): array
    {
        $timezones = [];

        foreach (\DateTimeZone::listIdentifiers($regions) as $timezone) {
            if ('intltimezone' === $input && 'Etc/Unknown' === \IntlTimeZone::createTimeZone($timezone)->getID()) {
                continue;
            }

            $timezones[str_replace(['/', '_'], [' / ', ' '], $timezone)] = $timezone;
        }

        return $timezones;
    }
948716
public function toArray()
    {
        $list = [];

        // Add popular timezones to list
        foreach ($this->popularTimezones as $key => $value) {
            $list['General'][$key] = $value;
        }

        // Add all timezone of continents to list
        foreach ($this->continents as $continent => $mask) {
            $timezones = DateTimeZone::listIdentifiers($mask);
            foreach ($timezones as $timezone) {
                $list[$continent][$timezone] = $this->formatTimezone($timezone, $continent);
            }
        }

        return $list;
    }
679504
function getTimezoneList() {

		$regions = [
			\DateTimeZone::AFRICA,
			\DateTimeZone::AMERICA,
			\DateTimeZone::ANTARCTICA,
			\DateTimeZone::ASIA,
			\DateTimeZone::ATLANTIC,
			\DateTimeZone::AUSTRALIA,
			\DateTimeZone::EUROPE,
			\DateTimeZone::INDIAN,
			\DateTimeZone::PACIFIC,
		];

		$timezones = array();

		foreach( $regions as $region ) {

			$timezones = array_merge( $timezones, \DateTimeZone::listIdentifiers( $region ) );
		}

		$timezone_offsets = array();

		foreach( $timezones as $timezone ) {

			$tz = new \DateTimeZone( $timezone );

			$timezone_offsets[$timezone] = $tz->getOffset( new DateTime );
		}

		// sort timezone by offset
		asort( $timezone_offsets );

		$timezone_list = array();

		foreach( $timezone_offsets as $timezone => $offset ) {

			$offset_prefix		= $offset < 0 ? '-' : '+';
			$offset_formatted 	= gmdate( 'H:i', abs($offset) );

			$pretty_offset 		= "UTC${offset_prefix}${offset_formatted}";

			$timezone_list[$timezone] = "(${pretty_offset}) $timezone";
		}

		return $timezone_list;
	}
314397
protected function getGroups()
	{
		$groups = array();

		$select = new HtmlSelect;

		// Try to inject the text object into the field
		try
		{
			$select->setText($this->getText());
		}
		catch (\RuntimeException $exception)
		{
			// A Text object was not set, ignore the error and try to continue processing
		}

		// Get the list of time zones from the server.
		$zones = \DateTimeZone::listIdentifiers();

		// Build the group lists.
		foreach ($zones as $zone)
		{
			// Time zones not in a group we will ignore.
			if (strpos($zone, '/') === false)
			{
				continue;
			}

			// Get the group/locale from the timezone.
			list ($group, $locale) = explode('/', $zone, 2);

			// Only use known groups.
			if (in_array($group, self::$zones))
			{
				// Initialize the group if necessary.
				if (!isset($groups[$group]))
				{
					$groups[$group] = array();
				}

				// Only add options where a locale exists.
				if (!empty($locale))
				{
					$groups[$group][$zone] = $select->option($zone, str_replace('_', ' ', $locale), 'value', 'text', false);
				}
			}
		}

		// Sort the group lists.
		ksort($groups);

		foreach ($groups as &$location)
		{
			sort($location);
		}

		// Merge any additional groups in the XML definition.
		$groups = array_merge(parent::getGroups(), $groups);

		return $groups;
	}
509419
private static function getHours(): array
    {
        $hours = [-1 => static::getConstant('TXT_DATETIME_HH', 'TXT_DATETIME_HH')];
        for ($i = 0; $i <= 23; $i++) {
            $hours[$i] = \sprintf('%02s', $i);
        }
        return $hours;
    }
391869
public static function getTimezonesByCountry() {
		$timezones = array();
		$tz_ids = array_keys(self::getTimezones(true, false, 'now', self::TIMEZONE_SORT_OFFSET));
		foreach ($tz_ids as $tz_id) {
			if ($tz_id == Util::UTC) {
				continue;
			}
			$info = Util::getTimezoneInfo($tz_id);
			$cc = $info->country_code;
			$abbr = $info->abbr;
			if (!isset($timezones[$cc])) {
				$timezones[$cc] = array();
			}
			$timezones[$cc][] = $info;
		}
		ksort($timezones);
		return $timezones;
	}
254832
public function getTimezone()
    {
        $dateTime = new Date();
        $dateTime->setTimeZone(new DateTimeZone($this->cachetTimezone));

        return $dateTime->format('T');
    }
870838
public function getSitesIdFromTimezones($timezones)
    {
        Piwik::checkUserHasSuperUserAccess();

        $timezones = Piwik::getArrayFromApiParameter($timezones);
        $timezones = array_unique($timezones);

        $ids = $this->getModel()->getSitesFromTimezones($timezones);

        $return = array();
        foreach ($ids as $id) {
            $return[] = $id['idsite'];
        }

        return $return;
    }
1089093
public static function getStartEndMonth() : array
    {
        date_default_timezone_set('UTC');
        $begin = mktime(0, 0, 0, date('m'), 1, date("Y"));
        $end = mktime(23, 59, 59, date('m'), date("t"), date("Y"));
        return [
            'begin' => $begin,
            'end' => $end
        ];
    }
634868
public static function getAll()
    {
        $timeZones = [];
        $timeZoneIdentifiers = \DateTimeZone::listIdentifiers();

        foreach ($timeZoneIdentifiers as $timeZone) {
            $date = new \DateTime('now', new \DateTimeZone($timeZone));
            $offset = $date->getOffset();
            $tz = ($offset > 0 ? '+' : '-') . gmdate('H:i', abs($offset));
            $timeZones[] = [
                'timezone' => $timeZone,
                'name' => "{$timeZone} (UTC {$tz})",
                'offset' => $offset
            ];
        }

        \yii\helpers\ArrayHelper::multisort($timeZones, 'offset', SORT_DESC, SORT_NUMERIC);

        return $timeZones;
    }
761967
private function _getTimeZoneId()
    {
        $timeZone = $this->localeDate->getConfigTimezone();
        $result = '085';
        if ($timeZone) {
            foreach ($this->timeZones as $time) {
                if ($time['MageTimeZone'] == $timeZone) {
                    $result = $time['MicrosoftTimeZoneIndex'];
                }
            }
        }

        return $result;
    }
742220
public function getJsonValue()
    {
        $dts = $this->getDateTimes();
        $hasTime = $this->hasTime();
        $isFloating = $this->isFloating();

        $tz = $dts[0]->getTimeZone();
        $isUtc = $isFloating ? false : in_array($tz->getName(), ['UTC', 'GMT', 'Z']);

        return array_map(
            function (DateTimeInterface $dt) use ($hasTime, $isUtc) {
                if ($hasTime) {
                    return $dt->format('Y-m-d\\TH:i:s').($isUtc ? 'Z' : '');
                } else {
                    return $dt->format('Y-m-d');
                }
            },
            $dts
        );
    }
273900
public function getDateTimePickerOptions()
    {
        if (! isset($this->dateTimePickerOptions['language']))
            $this->dateTimePickerOptions['language'] = config('app.locale');

        $available = ['en', 'pl', 'sv', 'de'];
        $this->dateTimePickerOptions['language'] =
            in_array($this->dateTimePickerOptions['language'], $available)
                ? $this->dateTimePickerOptions['language'] : 'en';

        return $this->dateTimePickerOptions;
    }
825440
public static function getListOfTimezones(string $locale = '') : array
    {
        date_default_timezone_set('UTC');
        $identifiers = \DateTimeZone::listIdentifiers();
        foreach($identifiers as $i) {
            // create date time zone from identifier
            $dtz = new \DateTimeZone($i);
            // create timezone from identifier
            $tz = \IntlTimeZone::createTimeZone($i);
            // if IntlTimeZone is unaware of timezone ID, use identifier as name, else use localized name
            if ($tz->getID() === 'Etc/Unknown' or $i === 'UTC') $name = $i;
            else $name =  $tz->getDisplayName(false, 3, $locale);
            // time offset
            $offset = $dtz->getOffset(new \DateTime());
            $sign   = ($offset < 0) ? '-' : '+';

            $tzs[] = [
                'code'   => $i,
                'name'   => $name . '(UTC' . $sign . date('H:i', abs($offset)) . ') ',
                'offset' => $offset,
            ];
        }
        ArrayHelper::multisort($tzs, ['offset', 'name']);
        // sort by offset
        //    usort($tzs, function($a, $b){
        //        if ($a['offset'] > $b['offset']) {
        //            return 1;
        //        }
        //        elseif ($a['offset'] < $b['offset']) {
        //            return -1;
        //        }
        //        elseif ($a['name'] > $b['name']) {
        //            return 1;
        //        }
        //        elseif ($a['name'] < $b['name']) {
        //            return -1;
        //        }
        //        return 0;
        //    });
        return array_column($tzs, 'name', 'code');
    }