How to pass a variable to a function?

As I said in my first reply, I can't see your code.
void getDateTime(StringBuffer) { doesn't make sense, which is why the compiler doesn't like it.