New getDate function and test bug correctioin