Period.from

Obtains an instance of {@code Period} from a temporal amount. !(p) This obtains a period 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 Period}. !(p) The conversion loops around the set of units from the amount and uses the {@link ChronoUnit#YEARS YEARS}, {@link ChronoUnit#MONTHS MONTHS} and {@link ChronoUnit#DAYS DAYS} units to create a period. If any other units are found then an exception is thrown. !(p) If the amount is a {@code ChronoPeriod} then it must use the ISO chronology.

@param amount the temporal amount to convert, not null @return the equivalent period, not null @throws DateTimeException if unable to convert to a {@code Period} @throws ArithmeticException if the amount of years, months or days exceeds an int

class Period
static
from

Meta