Converts date to datetime object before saving