simplify a bit

get rid of getdate() and take output directly into var