public function createDateTime($value)
    {
        $date = null;

        if(is_string($value)) {
            $date = new \DateTime($value);
        }

        if(is_int($value)) {
            $date = new \DateTime();
            $date->setTimestamp($value);
        }

        return $date;
    }
public function createDateTime($value)
    {
        $date = null;

        if(is_string($value)) {
            $date = new \DateTime($value);
        }

        if(is_int($value)) {
            $date = new \DateTime();
            $date->setTimestamp($value);
        }

        return $date;
    }
public function createDateTime ( $ value ) { $ date = null ; if ( is_string ( $ value ) ) { $ date = new \ DateTime ( $ value ) ; } if ( is_int ( $ value ) ) { $ date = new \ DateTime ( ) ; $ date -> setTimestamp ( $ value ) ; } return $ date ; }
Return DateTime object

@param $value
@return \DateTime
Return DateTime object