java 8 get the month from a date code example
Example 1: get day from date month year java
Calendar cal = Calendar.getInstance();
cal.set(year,month-1,day);
int nd = cal.get(Calendar.DAY_OF_WEEK);
Example 2: java get month
import java.time.ZoneId;
import java.util.Date;
new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate().getMonthValue();