add date_to_sring and tidy up test cases