Java LocalDateTime plusWeeks() Method

Beginner
5 min read
Updated: Nov 2026
3 examples
Java 8+

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.

Java
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
CallWhat 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
// java.time.LocalDateTime
public LocalDateTime plusWeeks(long weeks)

Parameters

ParameterDescription
weeks (long)The number of weeks to add. It can be zero or negative.

Return Value

Return ValueDescription
LocalDateTimeA new LocalDateTime with the weeks added. The original is not changed.

Compare with Similar Methods

Methods that move a date-time in time:

MethodHow 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

Example 1 — Plan a Weekly Meeting

A meeting starts on Monday at 14:00. Print the next three weekly dates.

Java
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));
    }
}

How It Works

  1. The first meeting. 16 March 2026 is a Monday, at 14:00.
  2. Always from the first date. Each call starts from first, so plusWeeks(1), (2), and (3) are 7, 14, and 21 days later.
  3. The weekday never changes. All four dates are Mondays at 14:00.
  4. 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.

Java
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));
    }
}

How It Works

  1. Three weeks. plusWeeks(3) adds 3 times 7 days.
  2. 21 days. plusDays(21) adds the same number of days, written by hand.
  3. Both land on 5 April. The date and time are identical.
  4. 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.

Java
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);
        }
    }
}

How It Works

  1. The first sprint. It begins on Monday 14 December 2026 at 09:00.
  2. The loop moves forward two weeks each time. sprint = sprint.plusWeeks(2) keeps the new value for the next round.
  3. Each date is a Monday. Two weeks is 14 days, so the weekday stays the same.
  4. The year changes. The second and third sprints start in January 2027.

Frequently Asked Questions

Call dt.plusWeeks(n). It returns a new LocalDateTime, so store it: dt = dt.plusWeeks(n).
No. LocalDateTime is immutable, so plusWeeks() returns a new object and leaves the original as it was.
Yes. A negative number moves the other way, so dt.plusWeeks(-n) gives the same result as dt.minusWeeks(n).
Exactly 7 days. plusWeeks(n) is the same as plusDays(n * 7).
Call dt.plusWeeks(1). The date moves forward by 7 days, so the day of the week stays the same.

Next: plusYears()

Return a copy that is a number of years later.

plusYears() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

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