Here you can find the source of getLastDayInMonth(LocalDate localDate)
public static int getLastDayInMonth(LocalDate localDate)
//package com.java2s; //License from project: Open Source License import java.time.*; import java.time.temporal.TemporalAdjusters; public class Main { public static int getLastDayInMonth(LocalDate localDate) { LocalDate result = localDate.with(TemporalAdjusters.lastDayOfMonth()); return result.getDayOfMonth(); }//ww w . j a v a2s .co m }