Java Date Time Java Java API
java.time.YearMonth
public Month getMonth()
Returns the month-of-year field of this YearMonth object as Month enum.
Month
package com.logicbig.example.yearmonth;import java.time.Month;import java.time.YearMonth;public class GetMonthExample { public static void main(String... args) { YearMonth y = YearMonth.of(2010, 11); System.out.println(y); Month month = y.getMonth(); System.out.println(month); }}
2010-11NOVEMBER