public function format(\DateTime $dateTime)
    {
        $formatted = preg_replace_callback($this->regExp, function ($matches) use ($dateTime) {
            return $this->formatReplace($matches[0], $dateTime);
        }, $this->pattern);

        return $formatted;
    }
public function format(\DateTime $dateTime)
    {
        $formatted = preg_replace_callback($this->regExp, function ($matches) use ($dateTime) {
            return $this->formatReplace($matches[0], $dateTime);
        }, $this->pattern);

        return $formatted;
    }
public function format ( \ DateTime $ dateTime ) { $ formatted = preg_replace_callback ( $ this -> regExp , function ( $ matches ) use ( $ dateTime ) { return $ this -> formatReplace ( $ matches [ 0 ] , $ dateTime ) ; } , $ this -> pattern ) ; return $ formatted ; }
Format a DateTime using ICU dateformat pattern.

@param \DateTime $dateTime A DateTime object to be used to generate the formatted value

@return string The formatted value
Format a DateTime using ICU dateformat pattern .