Year.from

Obtains an instance of {@code Year} from a temporal object. !(p) This obtains a year based on the specified temporal. A {@code TemporalAccessor} represents an arbitrary set of date and time information, which this factory converts to an instance of {@code Year}. !(p) The conversion extracts the {@link ChronoField#YEAR year} field. The extraction is only permitted if the temporal object has an ISO chronology, or can be converted to a {@code LocalDate}. !(p) This method matches the signature of the functional interface {@link TemporalQuery} allowing it to be used as a query via method reference, {@code Year.from}.

@param temporal the temporal object to convert, not null @return the year, not null @throws DateTimeException if unable to convert to a {@code Year}

class Year
static
from

Meta