Transformer/DateFormatTransformer.php
public function transform($value, array $options = [])
    {
        if (!$value) {
            return $value;
        }

        if ($value instanceof \DateTime) {
            $date = $value;
        } elseif (is_string($value)) {
            $date = new \DateTime($value);
        } else {
            throw new \UnexpectedValueException('Given value cannot be parsed into a date');
        }

        return $date->format($options['format']);
    }
public function transform($value, array $options = [])
    {
        if (!$value) {
            return $value;
        }

        if ($value instanceof \DateTime) {
            $date = $value;
        } elseif (is_string($value)) {
            $date = new \DateTime($value);
        } else {
            throw new \UnexpectedValueException('Given value cannot be parsed into a date');
        }

        return $date->format($options['format']);
    }
@param mixed $value
@param array $options

@return mixed|string