Gets valid time interval units collection.

@return array
174024
public static function getValidUnits()
    {
        return array(
            self::UNIT_HOUR,
            self::UNIT_DAY,
            self::UNIT_WEEK,
            self::UNIT_MONTH,
            self::UNIT_YEAR,
        );
    }
358506
public static function getTimeZones(): array
	{
		$timeZones = [];

		foreach(static::listIdentifiers() as $timeZone)
		{
			$timeZones[$timeZone] = str_replace('_', ' ', $timeZone);
		}

		return $timeZones;
	}
938987
private static function getMinutes(): array
    {
        $minutes = [-1 => static::getConstant('TXT_DATETIME_II', 'TXT_DATETIME_II')];
        for ($i = 0; $i <= 59; $i++) {
            $minutes[$i] = \sprintf('%02s', $i);
        }
        return $minutes;
    }
41422
public function getAll() : array
    {
        $convertedClaims = [];
        $timeFields = ['exp', 'nbf', 'iat'];

        // Convert date times to timestamps
        foreach ($this->claims as $name => $value) {
            if ($value !== null && in_array($name, $timeFields)) {
                /** @var DateTimeImmutable $value */
                $value = $value->getTimestamp();
            }

            $convertedClaims[$name] = $value;
        }

        if (!isset($this->claims['jti'])) {
            $convertedClaims['jti'] = $this->getId();
        }

        return $convertedClaims;
    }
836646
public function getActiveTimers()
    {
        $result = $this->getActiveUsers( );
        if ( $result->isSuccess() ) {
            $data = array();
            foreach ($result->data as $user) {
                $subResult = $this->getUserEntries( $user->id, Range::today( $this->_timeZone ) );
                if ( $subResult->isSuccess() ) {
                    foreach ($subResult->data as $entry) {
                        if ($entry->timer_started_at != null || $entry->timer_started_at != "") {
                            $data[$user->id] = $entry;
                            break;
                        }
                    }
                }
            }
            $result->data = $data;
        }

        return $result;
    }
502341
public function getTempoEspera()
    {
        if ($this->tempoEspera) {
            return $this->secondsToDateInterval($this->tempoEspera);
        }
        
        $now = new DateTime();
        $interval = $now->diff($this->getDataChegada());

        return $interval;
    }
407842
public function calculateTimings()
    {
        if ($this->_timings === null) {
            $this->_timings = Yii::getLogger()->calculateTimings(isset($this->data['messages']) ? $this->data['messages'] : []);
        }

        return $this->_timings;
    }
1041155
@Override
    public List<TemporalUnit> getUnits() {
        return Collections.<TemporalUnit>unmodifiableList(Arrays.asList(SECONDS, NANOS));
    }
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;
	}
415770
private function getTimeZoneList(): array
    {
        if (count($this->timeZoneList) === 0) {
            $this->timeZoneList = DateTimeUtils::getTimeZoneList();
        }

        return $this->timeZoneList;
    }
861758
public function getTimestamp()
    {
        $name = $this->name;
        $this->timestamp = $this->resource->getTimestamp($name, $this->sdopx);
        return $this->timestamp;
    }
20378
public List<TimeUnit> getUnits()
   {
      if (cachedUnits == null) {
         List<TimeUnit> result = new ArrayList<TimeUnit>(units.keySet());
         Collections.sort(result, new TimeUnitComparator());
         cachedUnits = Collections.unmodifiableList(result);
      }

      return cachedUnits;
   }
694584
public function TimezoneToInterval()
	{
		// Get the timezone
		$timezone = $this->Value->getTimezone()->getName();

		// No deviation returns an empty sequence
		if ( $timezone == "Z" || $timezone == "+00:00" || $timezone == date_default_timezone_get() )
		{
			return DayTimeDurationValue::Parse( "PT0S" );
			// /MinimalConformance/Functions/DurationDateTimeFunc/ComponentExtractionDDT
			// K-TimezoneFromDateFunc-7
			// return Undefined::getValue();
		}

		// Create an interval string
		if ( ! preg_match( "/(?<sign>[+-])(?<hours>\d{2,2}):(?<minutes>\d{2,2})/", $timezone, $matches ) )
		{
			return Undefined::getValue();
		}

		$invert = $matches['sign'] == '-' ? '-' : '';

		return DayTimeDurationValue::Parse( "{$invert}PT{$matches['hours']}H{$matches['minutes']}M" );

	}
1101095
public function get_unit_options() {
        $options = array();
        foreach ($this->units as $unit => $notused) {
            $options[$unit] = $unit;
        }
        return $options;
    }
494445
public function getScheduledEvents()
    {
        $schedule = app(Schedule::class);

        $events = array_map(function ($event) {
            $e = $this->convertEvent($event);
            return [
                'schedule' => $e->expression,
                'command' => $e->getCommandName(),
                'timezone' => $e->timezone,
                'mutex' => $e->mutexName(),
                'run_in_background' => $e->runInBackground,
                'without_overlapping' => $e->withoutOverlapping,
                'on_one_server' => $e->onOneServer,
                'next_run_due' => $e->getNextRunDue($e->expression, $e->timezone),
                'next_check_due' => $e->getNextCheckDue($e->expression, $e->timezone)
            ];
        }, $schedule->events());

        return $events;
    }
796622
public static function getPeriodToFrequency()
    {
        return array(
            Schedule::PERIOD_NEVER => Piwik::translate('General_Never'),
            Schedule::PERIOD_DAY   => Piwik::translate('General_Daily'),
            Schedule::PERIOD_WEEK  => Piwik::translate('General_Weekly'),
            Schedule::PERIOD_MONTH => Piwik::translate('General_Monthly'),
        );
    }
768167
private function getTimeCase()
    {
        $from = $this->from;
        $to = $this->to;

        // Single hour event
        if (!$to || $to->format('Hi') === $from->format('Hi')) {
            if ($to->format('i') == 0) {
                return 'single_round';
            }

            return 'single';
        }

        $fromTime = [
            'hour'   => $from->format('H'),
            'minute' => $from->format('i'),
        ];

        $toTime = [
            'hour'   => $to->format('H'),
            'minute' => $to->format('i'),
        ];

        $case = null;
        $case = $fromTime['hour'] !== $toTime['hour'] ? 'different_time' : $case;
        $case = $fromTime['minute'] == 0 ? 'different_time_round' : $case;
        $case = $fromTime['minute'] != $toTime['minute'] ? 'different_time' : $case;

        return $case;
    }