Wrote code for date_ok() function