src/Filters/FormatDateFilter.php
public function filter($value, array $options = [])
    {
        if ( ! is_string($value) || empty(trim($value)))
            return $value;

        $this->checkOptions($options);

        list($currentFormat, $targetFormat) = array_map('trim', $options);

        return DateTime::createFromFormat($currentFormat, $value)->format($targetFormat);
    }
public function filter($value, array $options = [])
    {
        if ( ! is_string($value) || empty(trim($value)))
            return $value;

        $this->checkOptions($options);

        list($currentFormat, $targetFormat) = array_map('trim', $options);

        return DateTime::createFromFormat($currentFormat, $value)->format($targetFormat);
    }
public function filter ( $ value , array $ options = [ ] ) { if ( ! is_string ( $ value ) || empty ( trim ( $ value ) ) ) return $ value ; $ this -> checkOptions ( $ options ) ; list ( $ currentFormat , $ targetFormat ) = array_map ( 'trim' , $ options ) ; return DateTime :: createFromFormat ( $ currentFormat , $ value ) -> format ( $ targetFormat ) ; }
Format date of the given string.

@param  mixed  $value
@param  array  $options

@return string|mixed
Format date of the given string .