protected function getValidTimestamp($value)
    {
        if (gettype($value) == 'integer') {
            return $value;
        }

        if ($value instanceof DateTime) {
            return $value->getTimestamp();
        }

        throw new UnexpectedValueException('Instance of DateTime required for a valid timestamp');
    }
protected function getValidTimestamp($value)
    {
        if (gettype($value) == 'integer') {
            return $value;
        }

        if ($value instanceof DateTime) {
            return $value->getTimestamp();
        }

        throw new UnexpectedValueException('Instance of DateTime required for a valid timestamp');
    }
protected function getValidTimestamp ( $ value ) { if ( gettype ( $ value ) == 'integer' ) { return $ value ; } if ( $ value instanceof DateTime ) { return $ value -> getTimestamp ( ) ; } throw new UnexpectedValueException ( 'Instance of DateTime required for a valid timestamp' ) ; }
Make sure the tmiestamp is formatted in seconds after epoch
@param \DateTime|integer $value
@return int
@throws \UnexpectedValueException
Make sure the tmiestamp is formatted in seconds after epoch