How to pass a variable to a function?

Thats what I mean, something like

getDateTime(StringBuffer); // pass StringBuffer to getDateTime Function

If I do this

void getDateTime(StringBuffer) {
              //Extract Date and Time from stringbuffer               
        String timeBuffer = String (StringBuffer);
        String timeString = timeBuffer.substring(5,5 + dateLength);
        Serial.print("Raw TimeDate String = ");    
        Serial.println(timeString);
}

The I get variable or field getDateTime declared void, I thought void is used when no value is returned as is the case here?

This is why I need to know the correct way of doing this.

Thanks!