changing date string into a datetime type