add the function of getTime