Corrects error on calculate diff between two dates