code: private int timeSkewInSeconds(Date clientTime, Date serverTime) {
          ValidationUtils.assertNotNull(clientTime, "clientTime");
          ValidationUtils.assertNotNull(serverTime, "serverTime");
  
          long value = (clientTime.getTime() - serverTime.getTime()) / 1000;
  
          if ((int) value != value) {
              throw new IllegalStateException("Time is too skewed to adjust: (clientTime: " + clientTime.getTime() + ", " +
                                              "serverTime: " + serverTime.getTime() + ")");
          }
          return (int) value;
      }
docs: Calculate the time skew between a client and server date. This value has the same semantics of
  {@link Request#setTimeOffset(int)}. Positive values imply the client clock is "fast" and negative values imply
  the client clock is "slow".