public function reverseTransform($value)
    {
        if (null === $value) {
            return;
        }

        if (!is_numeric($value)) {
            throw new TransformationFailedException('Expected a numeric.');
        }

        try {
            $dateTime = new \DateTime();
            $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone));
            $dateTime->setTimestamp($value);

            if ($this->inputTimezone !== $this->outputTimezone) {
                $dateTime->setTimezone(new \DateTimeZone($this->inputTimezone));
            }
        } catch (\Exception $e) {
            throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e);
        }

        return $dateTime;
    }
public function reverseTransform($value)
    {
        if (null === $value) {
            return;
        }

        if (!is_numeric($value)) {
            throw new TransformationFailedException('Expected a numeric.');
        }

        try {
            $dateTime = new \DateTime();
            $dateTime->setTimezone(new \DateTimeZone($this->outputTimezone));
            $dateTime->setTimestamp($value);

            if ($this->inputTimezone !== $this->outputTimezone) {
                $dateTime->setTimezone(new \DateTimeZone($this->inputTimezone));
            }
        } catch (\Exception $e) {
            throw new TransformationFailedException($e->getMessage(), $e->getCode(), $e);
        }

        return $dateTime;
    }
public function reverseTransform ( $ value ) { if ( null === $ value ) { return ; } if ( ! is_numeric ( $ value ) ) { throw new TransformationFailedException ( 'Expected a numeric.' ) ; } try { $ dateTime = new \ DateTime ( ) ; $ dateTime -> setTimezone ( new \ DateTimeZone ( $ this -> outputTimezone ) ) ; $ dateTime -> setTimestamp ( $ value ) ; if ( $ this -> inputTimezone !== $ this -> outputTimezone ) { $ dateTime -> setTimezone ( new \ DateTimeZone ( $ this -> inputTimezone ) ) ; } } catch ( \ Exception $ e ) { throw new TransformationFailedException ( $ e -> getMessage ( ) , $ e -> getCode ( ) , $ e ) ; } return $ dateTime ; }
Transforms a timestamp in the configured timezone into a DateTime object.

@param string $value A timestamp

@return \DateTime A \DateTime object

@throws TransformationFailedException If the given value is not a timestamp
or if the given timestamp is invalid
Transforms a timestamp in the configured timezone into a DateTime object .