Converting string of dates into datetime