TemporalAdjusters firstDayOfNextMonth() method in Java with Examples
The firstDayOfNextMonth() method of a TemporalAdjusters class is used to return the “first day of next month” TemporalAdjuster object, which returns a new Date object set to the first day of the next month.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public static TemporalAdjuster firstDayOfNextMonth()
Parameters: This method accepts nothing.
Return value: This method returns the first day of next month adjuster, not null.
Below programs illustrate the TemporalAdjusters.firstDayOfNextMonth() method:
First day of next month for localdate 2020-05-11: 2020-06-01
First day of next month for localdate 2010-12-29: 2011-01-01