Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Java Program to adjust Adjust LocalDate to first Day Of next month

import java.time.LocalDate;
import java.time.Month;
import java.time.temporal.TemporalAdjusters;
public class Demo {
	public static void main(String[] args) {
		LocalDate localDate = LocalDate.of(2019, Month.JUNE, 15);
		System.out.println("Current Date = "+localDate);
		System.out.println("Current Month = "+localDate.getMonth());
		LocalDate day = localDate.with(TemporalAdjusters.firstDayOfMonth());
		System.out.println("First day of month = "+day);
		day = localDate.with(TemporalAdjusters.firstDayOfNextMonth());
		System.out.println("First day of next month = "+day);
	}
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.