Templating/Helper/Format/IntlFormatter.php
protected function intlDateTimeFormat(\DateTimeInterface $dateTime, $dateType, $timeType, $timezone, $locale)
    {
        if (!isset(static::$dateFormatTypes[$dateType])) {
            throw new \InvalidArgumentException(\sprintf('Invalid date type "%s", valid types are: %s', $dateType, \implode(', ', \array_keys(static::$dateFormatTypes))));
        }
        if (!isset(static::$dateFormatTypes[$dateType])) {
            throw new \InvalidArgumentException(\sprintf('Invalid time type "%s", valid types are: %s', $timeType, \implode(', ', \array_keys(static::$dateFormatTypes))));
        }
        if (!$locale) {
            $locale = Locale::getDefault();
        }

        $formatter = new IntlDateFormatter(
            $locale,
            static::$dateFormatTypes[$dateType],
            static::$dateFormatTypes[$timeType],
            $timezone ?: $dateTime->getTimezone()
        );

        if ($pattern = $this->getIntlDatePattern($locale, $dateType, $timeType)) {
            $formatter->setPattern($pattern);
        }

        return $formatter->format($dateTime);
    }
protected function intlDateTimeFormat(\DateTimeInterface $dateTime, $dateType, $timeType, $timezone, $locale)
    {
        if (!isset(static::$dateFormatTypes[$dateType])) {
            throw new \InvalidArgumentException(\sprintf('Invalid date type "%s", valid types are: %s', $dateType, \implode(', ', \array_keys(static::$dateFormatTypes))));
        }
        if (!isset(static::$dateFormatTypes[$dateType])) {
            throw new \InvalidArgumentException(\sprintf('Invalid time type "%s", valid types are: %s', $timeType, \implode(', ', \array_keys(static::$dateFormatTypes))));
        }
        if (!$locale) {
            $locale = Locale::getDefault();
        }

        $formatter = new IntlDateFormatter(
            $locale,
            static::$dateFormatTypes[$dateType],
            static::$dateFormatTypes[$timeType],
            $timezone ?: $dateTime->getTimezone()
        );

        if ($pattern = $this->getIntlDatePattern($locale, $dateType, $timeType)) {
            $formatter->setPattern($pattern);
        }

        return $formatter->format($dateTime);
    }
@param \DateTimeInterface $dateTime
@param string $dateType
@param string $timeType
@param mixed $timezone
@param string|null $locale

@return string|bool