get last day of the month java code example
Example 1: Get the last Friday of a month in Java
LocalDate now = LocalDate.now();
LocalDate lastFriday = now.with(TemporalAdjusters.lastInMonth(DayOfWeek.FRIDAY));
Example 2: get last day of month java
Calendar cal = Calendar.getInstance();
cal.set(Calendar.DATE, cal.getActualMaximum(Calendar.DATE));
Date lastDayOfMonth = cal.getTime();