added datetimediff calculation function