Let us take a look at how to add one day to a Date or LocalDate object in Java with examples.
Example 1: Using Data (Java 7 or below)
public static void main(String... args) {
Date currentDate = new Date();
Calendar calendar = Calendar.getInstance();
calendar.setTime(currentDate);
calendar.add(Calendar.DAY_OF_MONTH, 1);
Date tomorrowDate = calendar.getTime();
System.out.println("Current Date: " + currentDate);
System.out.println("Tomorrow's Date: " + tomorrowDate);
}
Output:
Example 2: Using LocalDate (Java 8 and above)
public static void main(String... args) {
LocalDate currentDate = LocalDate.now();
LocalDate tomorrowDate = currentDate.plusDays(1);
System.out.println("Current Date: " + currentDate);
System.out.println("Tomorrow's Date: " + tomorrowDate);
}

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!