Month.from

Obtains an instance of {@code Month} from a temporal object. !(p) This obtains a month 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 Month}. !(p) The conversion extracts the {@link ChronoField#MONTH_OF_YEAR MONTH_OF_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 Month::from}.

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

class Month
static
from

Meta