Java examples for java.time:Month
Creates a new date object with the last day of the same month as the given date.
//package com.java2s; import java.time.LocalDate; public class Main { /**//from w w w .j a v a 2 s .c om * Creates a new date object with the last day of the same month as the * given date. */ public static LocalDate endOfMonth(LocalDate date) { return date.withDayOfMonth(date.lengthOfMonth()); } }