changing the date function