return date in function