Home Java LocalDateTime Methods plusWeeks() Java LocalDateTime plusWeeks() Method Definition In Java, plusWeeks(weeks) returns a new LocalDateTime that is the given number of weeks later than the original. Each week is exactly 7 days, and the time of day stays the same.
LocalDateTime is immutable , so the original object never changes. Always keep the result: dt = dt.plusWeeks(1);. It is handy for weekly schedules, such as a meeting that repeats every Monday.
An instance method of java.time.LocalDateTime (since Java 8): call it on a LocalDateTime object. Add import java.time.LocalDateTime; at the top of your file.
Syntax Call it on a LocalDateTime and pass the number of weeks. A negative number goes the other way.
LocalDateTime start = LocalDateTime.of(2026, 3, 16, 14, 0);
LocalDateTime result = start.plusWeeks(2); // 2026-03-30T14:00
System.out.println(start); // 2026-03-16T14:00 Call What it does dt.plusWeeks(n)Returns a new date-time with n weeks added. dt.minusWeeks(n)The same idea in the opposite direction. dt.plus(n, ChronoUnit.WEEKS)The general form. It does the same thing for this unit. date.plusWeeks(n)LocalDate has the same method, but it has no time of day.
The result is a new object . Calling plusWeeks() without using the returned value does nothing useful.
Library declarations // java.time.LocalDateTime
public LocalDateTime plusWeeks(long weeks) Parameters Parameter Description weeks (long)The number of weeks to add. It can be zero or negative.
Return Value Return Value Description LocalDateTimeA new LocalDateTime with the weeks added. The original is not changed.
Compare with Similar Methods Methods that move a date-time in time:
Method How it differs minusWeeks(n)The opposite direction for weeks. plus(n, unit)The general method: you choose the unit as an argument. plusDays(n)Adds single days. plusWeeks(1) equals plusDays(7). plusMonths(n)Adds calendar months, which are not all the same length.
Java Examples 1. Weekly meeting 2. Weeks vs days 3. Sprint calendar Example 1 — Plan a Weekly Meeting A meeting starts on Monday at 14:00. Print the next three weekly dates.
import java.time.LocalDateTime;
public class LdtPlusWeeksDemo {
public static void main(String[] args) {
LocalDateTime first = LocalDateTime.of(2026, 3, 16, 14, 0);
System.out.println("week 0: " + first);
System.out.println("week 1: " + first.plusWeeks(1));
System.out.println("week 2: " + first.plusWeeks(2));
System.out.println("week 3: " + first.plusWeeks(3));
}
} week 0: 2026-03-16T14:00
week 1: 2026-03-23T14:00
week 2: 2026-03-30T14:00
week 3: 2026-04-06T14:00 How It Works The first meeting. 16 March 2026 is a Monday, at 14:00.Always from the first date. Each call starts from first, so plusWeeks(1), (2), and (3) are 7, 14, and 21 days later.The weekday never changes. All four dates are Mondays at 14:00.The month rolls over. The last date is in April.Example 2 — Compare plusWeeks with plusDays Add three weeks, then add the same period as 21 days, and compare the two answers.
import java.time.LocalDateTime;
public class LdtPlusWeeksVsDays {
public static void main(String[] args) {
LocalDateTime start = LocalDateTime.of(2026, 3, 15, 10, 30);
LocalDateTime byWeeks = start.plusWeeks(3);
LocalDateTime byDays = start.plusDays(21);
System.out.println("by weeks: " + byWeeks);
System.out.println("by days: " + byDays);
System.out.println("same: " + byWeeks.equals(byDays));
}
} by weeks: 2026-04-05T10:30
by days: 2026-04-05T10:30
same: true How It Works Three weeks. plusWeeks(3) adds 3 times 7 days.21 days. plusDays(21) adds the same number of days, written by hand.Both land on 5 April. The date and time are identical.equals confirms it. The two objects represent the same date-time, so equals prints true.Example 3 — Build a Sprint Calendar Across the New Year Two-week sprints start every second Monday. Use a loop to print the start of the next three sprints.
import java.time.LocalDateTime;
public class LdtPlusWeeksSprints {
public static void main(String[] args) {
LocalDateTime sprint = LocalDateTime.of(2026, 12, 14, 9, 0);
for (int i = 1; i <= 3; i++) {
sprint = sprint.plusWeeks(2);
System.out.println("sprint " + i + " starts: " + sprint);
}
}
} sprint 1 starts: 2026-12-28T09:00
sprint 2 starts: 2027-01-11T09:00
sprint 3 starts: 2027-01-25T09:00 How It Works The first sprint. It begins on Monday 14 December 2026 at 09:00.The loop moves forward two weeks each time. sprint = sprint.plusWeeks(2) keeps the new value for the next round.Each date is a Monday. Two weeks is 14 days, so the weekday stays the same.The year changes. The second and third sprints start in January 2027.Frequently Asked Questions How do I add weeks to a LocalDateTime in Java? Call dt.plusWeeks(n). It returns a new LocalDateTime, so store it: dt = dt.plusWeeks(n).
Does plusWeeks() change the original LocalDateTime? No. LocalDateTime is immutable, so plusWeeks() returns a new object and leaves the original as it was.
Can I pass a negative number to plusWeeks()? Yes. A negative number moves the other way, so dt.plusWeeks(-n) gives the same result as dt.minusWeeks(n).
How many days does plusWeeks(1) add? Exactly 7 days. plusWeeks(n) is the same as plusDays(n * 7).
How do I find the same weekday next week in Java? Call dt.plusWeeks(1). The date moves forward by 7 days, so the day of the week stays the same.
About the author Developer, cloud engineer, and technical writer
I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.
15 people found this page helpful
Helpful Share Copy link Suggestion