Swat/SwatDate.php
public function formatLikeIntl($format, $tz_format = null, $locale = null)
    {
        if (is_int($format)) {
            $format = self::getFormatLikeIntlById($format);
        }

        if ($locale == '') {
            $locale = setlocale(LC_TIME, 0);
        }

        static $formatters = array();

        if (!isset($formatters[$locale])) {
            $formatters[$locale] = new IntlDateFormatter(
                $locale,
                IntlDateFormatter::FULL,
                IntlDateFormatter::FULL
            );
        }

        $formatter = $formatters[$locale];
        $formatter->setTimeZone($this->getTimezone()->getName());
        $formatter->setPattern($format);

        $timestamp = $this->getTimestamp();
        $out = $formatter->format($timestamp);

        if ($tz_format !== null) {
            $out .= ' ' . $this->formatTZ($tz_format);
        }

        return $out;
    }
public function formatLikeIntl($format, $tz_format = null, $locale = null)
    {
        if (is_int($format)) {
            $format = self::getFormatLikeIntlById($format);
        }

        if ($locale == '') {
            $locale = setlocale(LC_TIME, 0);
        }

        static $formatters = array();

        if (!isset($formatters[$locale])) {
            $formatters[$locale] = new IntlDateFormatter(
                $locale,
                IntlDateFormatter::FULL,
                IntlDateFormatter::FULL
            );
        }

        $formatter = $formatters[$locale];
        $formatter->setTimeZone($this->getTimezone()->getName());
        $formatter->setPattern($format);

        $timestamp = $this->getTimestamp();
        $out = $formatter->format($timestamp);

        if ($tz_format !== null) {
            $out .= ' ' . $this->formatTZ($tz_format);
        }

        return $out;
    }
public function formatLikeIntl ( $ format , $ tz_format = null , $ locale = null ) { if ( is_int ( $ format ) ) { $ format = self :: getFormatLikeIntlById ( $ format ) ; } if ( $ locale == '' ) { $ locale = setlocale ( LC_TIME , 0 ) ; } static $ formatters = array ( ) ; if ( ! isset ( $ formatters [ $ locale ] ) ) { $ formatters [ $ locale ] = new IntlDateFormatter ( $ locale , IntlDateFormatter :: FULL , IntlDateFormatter :: FULL ) ; } $ formatter = $ formatters [ $ locale ] ; $ formatter -> setTimeZone ( $ this -> getTimezone ( ) -> getName ( ) ) ; $ formatter -> setPattern ( $ format ) ; $ timestamp = $ this -> getTimestamp ( ) ; $ out = $ formatter -> format ( $ timestamp ) ; if ( $ tz_format !== null ) { $ out .= ' ' . $ this -> formatTZ ( $ tz_format ) ; } return $ out ; }
Formats this date using the ICU IntlDateFormater given either a format
string or a format id

This method returns localized results.

@param mixed $format either a format string or an integer format id.
@param integer $tz_format optional. A time zone format id.
@param string $locale optional. The locale to use to format the date.
If not specified, the current locale is used.

@return string the formatted date according to the current locale.
Formats this date using the ICU IntlDateFormater given either a format string or a format id