Implemented updateDate function