added buffer resize to make sure output buffer always matches time string