Here you can find the source of getEndDateOfMonth(LocalDate date)
public static LocalDate getEndDateOfMonth(LocalDate date)
//package com.java2s; //License from project: Apache License import java.time.LocalDate; public class Main { public static LocalDate getEndDateOfMonth(LocalDate date) { int[] ends = { 31, 30, 29, 28 }; for (int e : ends) { try { LocalDate eom = date.withDayOfMonth(e); return eom; } catch (Exception ex) { //JUST FORGET THIS. }//from w w w .j a va2 s . com } return null; } }