Java LocalDateTime plus() Method

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

Definition

In Java, plus(...) returns a new LocalDateTime that is later than the original. There are two versions. One takes a number and a TemporalUnit, such as plus(2, ChronoUnit.HOURS). The other takes a TemporalAmount, which is a Duration or a Period.

The methods plusDays(), plusHours() and the others are shortcuts. plus() reaches every unit, including weeks, decades, and half-days.

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. It comes from Temporal, which LocalDateTime implements.

Syntax

Pass a number and a unit, or pass a Duration or Period.

Java
LocalDateTime dt = LocalDateTime.of(2026, 3, 15, 10, 30);
LocalDateTime a = dt.plus(1, ChronoUnit.WEEKS);           // 2026-03-22T10:30
LocalDateTime b = dt.plus(Duration.ofMinutes(90));        // 2026-03-15T12:00
LocalDateTime c = dt.plus(Period.ofMonths(1));            // 2026-04-15T10:30
CallWhat it does
dt.plus(n, unit)Adds n of a ChronoUnit, such as WEEKS or HOURS.
dt.plus(duration)Adds a Duration, which is an amount of time in seconds.
dt.plus(period)Adds a Period, which is an amount in years, months, and days.
dt.plusDays(n)The shortcut for plus(n, ChronoUnit.DAYS).

The original is never changed. plus() returns a new LocalDateTime.

Library declarations
Java
// java.time.LocalDateTime
public LocalDateTime plus(long amountToAdd, TemporalUnit unit)
public LocalDateTime plus(TemporalAmount amountToAdd)

Parameters

ParameterDescription
amountToAdd (long)The number of units to add. It can be negative.
unit (TemporalUnit)The unit, such as ChronoUnit.MINUTES.
amountToAdd (TemporalAmount)A Duration or a Period. Use this version without the unit.

Return Value

Return ValueDescription
LocalDateTimeA new LocalDateTime with the amount added.

Compare with Similar Methods

Ways to move a date-time:

MethodHow it differs
minus(n, unit)The opposite direction.
plusDays(n)A shortcut for one unit.
until(end, unit)Measures the distance instead of moving.

Java Examples

Example 1 — Add in Different Units

Add a week, two hours, a decade, and half a day to the same date-time.

Java
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public class LdtPlusUnits {
    public static void main(String[] args) {
        LocalDateTime dt = LocalDateTime.of(2026, 3, 15, 10, 30);

        System.out.println("+1 week:     " + dt.plus(1, ChronoUnit.WEEKS));
        System.out.println("+2 hours:    " + dt.plus(2, ChronoUnit.HOURS));
        System.out.println("+1 decade:   " + dt.plus(1, ChronoUnit.DECADES));
        System.out.println("+1 half day: " + dt.plus(1, ChronoUnit.HALF_DAYS));
    }
}

How It Works

  1. One method, many units. The unit decides what 1 means.
  2. A week and two hours. The results are 22 March at 10:30 and 15 March at 12:30.
  3. A decade. Ten years later is 15 March 2036.
  4. Half a day. HALF_DAYS is 12 hours, so 10:30 becomes 22:30.

Example 2 — Add a Duration and a Period

Add 90 minutes as a Duration, one month as a Period, and a mixed Period of years, months, and days.

Java
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.Period;

public class LdtPlusAmounts {
    public static void main(String[] args) {
        LocalDateTime dt = LocalDateTime.of(2026, 3, 15, 10, 30);

        System.out.println("90 minutes:     " + dt.plus(Duration.ofMinutes(90)));
        System.out.println("1 month:        " + dt.plus(Period.ofMonths(1)));
        System.out.println("1y 2m 3d:       " + dt.plus(Period.of(1, 2, 3)));
    }
}

How It Works

  1. A Duration is exact time. 90 minutes after 10:30 is 12:00.
  2. A Period is calendar time. One month later is the same day in April.
  3. A mixed Period. 1 year and 2 months give 15 May 2027, and the 3 extra days make it 18 May 2027.

Example 3 — Pick the Unit at Run Time

Loop over several units and add one of each. Then try the unit FOREVER.

Java
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
import java.time.temporal.UnsupportedTemporalTypeException;

public class LdtPlusRuntime {
    public static void main(String[] args) {
        LocalDateTime dt = LocalDateTime.of(2026, 3, 15, 10, 30);
        ChronoUnit[] units = {ChronoUnit.MINUTES, ChronoUnit.HOURS, ChronoUnit.DAYS};

        for (ChronoUnit unit : units) {
            System.out.println("+1 " + unit + ": " + dt.plus(1, unit));
        }
        try {
            dt.plus(1, ChronoUnit.FOREVER);
        } catch (UnsupportedTemporalTypeException e) {
            System.out.println("FOREVER -> UnsupportedTemporalTypeException");
        }
    }
}

How It Works

  1. The unit is a value. Because it is an argument, you can keep units in an array and choose them while the program runs.
  2. One of each. Adding 1 minute, 1 hour, and 1 day gives 10:31, 11:30, and the next day at 10:30.
  3. FOREVER cannot be added. It means "no end", so plus() throws an UnsupportedTemporalTypeException.

Frequently Asked Questions

Use dt.plus(Duration.ofMinutes(90)). A Duration is an exact length of time.
Use dt.plus(Period.ofMonths(1)) or Period.of(years, months, days). It follows calendar rules.
There is no difference. plusDays(n) is a shortcut for the same call.
All of them except FOREVER, from NANOS up to ERAS. For example WEEKS, DECADES, CENTURIES, and HALF_DAYS.
Use minus(n, unit), or pass a negative number such as plus(-1, ChronoUnit.DAYS).

Next: plusDays()

Return a copy that is a number of days later.

plusDays() 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.

8 people found this page helpful