code: public static Duration between(Temporal startInclusive, Temporal endExclusive) {
          long secs = startInclusive.until(endExclusive, SECONDS);
          long nanos = 0;
          if (startInclusive.isSupported(NANO_OF_SECOND) && endExclusive.isSupported(NANO_OF_SECOND)) {
              try {
                  long startNos = startInclusive.getLong(NANO_OF_SECOND);
                  nanos = endExclusive.getLong(NANO_OF_SECOND) - startNos;
                  if (secs > 0 && nanos < 0) {
                      nanos += NANOS_PER_SECOND;
                  } else if (secs < 0 && nanos > 0) {
                      nanos -= NANOS_PER_SECOND;
                  } else if (secs == 0 && nanos != 0) {
                      // two possible meanings for result, so recalculate secs
                      Temporal adjustedEnd = endExclusive.with(NANO_OF_SECOND, startNos);
                      secs = startInclusive.until(adjustedEnd, SECONDS);;
                  }
              } catch (DateTimeException ex2) {
                  // ignore and only use seconds
              } catch (ArithmeticException ex2) {
                  // ignore and only use seconds
              }
          }
          return ofSeconds(secs, nanos);
      }
docs: Obtains an instance of {@code Duration} representing the duration between two instants.
  <p>
  Obtains a {@code Duration} representing the duration between two instants.
  This calculates the duration between two temporal objects of the same type.
  The difference in seconds is calculated using {@link Temporal#until(Temporal, TemporalUnit)}.
  The difference in nanoseconds is calculated using by querying the
  {@link ChronoField#NANO_OF_SECOND NANO_OF_SECOND} field.
  <p>
  The result of this method can be a negative period if the end is before the start.
  To guarantee to obtain a positive duration call abs() on the result.
  
  @param startInclusive  the start instant, inclusive, not null
  @param endExclusive  the end instant, exclusive, not null
  @return a {@code Duration}, not null
  @throws DateTimeException if the seconds between the temporals cannot be obtained
  @throws ArithmeticException if the calculation exceeds the capacity of {@code Duration}