created and tested getDate function