Implemented new function to set the date