add the function "toDate"