format timestamps with invalid date input

fixes #4989