code: public static Days from(TemporalAmount amount) {
          if (amount instanceof Days) {
              return (Days) amount;
          }
          Objects.requireNonNull(amount, "amount");
          int days = 0;
          for (TemporalUnit unit : amount.getUnits()) {
              long value = amount.get(unit);
              if (value != 0) {
                  long[] converted = Temporals.convertAmount(value, unit, DAYS);
                  if (converted[1] != 0) {
                      throw new DateTimeException(
                              "Amount could not be converted to a whole number of days: " + value + " " + unit);
                  }
                  days = Math.addExact(days, Math.toIntExact(converted[0]));
              }
          }
          return of(days);
      }
docs: Obtains an instance of {@code Days} from a temporal amount.
  <p>
  This obtains an instance based on the specified amount.
  A {@code TemporalAmount} represents an amount of time, which may be
  date-based or time-based, which this factory extracts to a {@code Days}.
  <p>
  The result is calculated by looping around each unit in the specified amount.
  Each amount is converted to days using {@link Temporals#convertAmount}.
  If the conversion yields a remainder, an exception is thrown.
  If the amount is zero, the unit is ignored.
  
  @param amount  the temporal amount to convert, not null
  @return the equivalent amount, not null
  @throws DateTimeException if unable to convert to a {@code Days}
  @throws ArithmeticException if numeric overflow occurs