avoid overflow in timestamp calcs