removed the duplication of convertDate() function