Java Date convert to Month
import java.time.Month; import java.util.Calendar; import java.util.Date; public class Main { public static void main(String[] args) { System.out.println(getMonth(new Date())); }/* w w w .j ava 2 s .com*/ public static Month getMonth(Date date) { return Month.of(getMonthInt(date)); } public static int getMonthInt(Calendar calendar) { return calendar.get(Calendar.MONTH) + 1; } public static int getMonthInt(Date date) { return getMonthInt(getCalendar(date)); } public static Calendar getCalendar(Date date) { Calendar cal = Calendar.getInstance(); cal.setTime(date); return cal; } }