Java LocalDateTime plusMinutes() Method

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

Definition

In Java, plusMinutes(minutes) returns a new LocalDateTime that is the given number of minutes later than the original. The seconds and nanoseconds stay the same.

LocalDateTime is immutable, so the original object never changes. Always keep the result: dt = dt.plusMinutes(1);. When the minutes pass 60, the hour changes, and when they pass midnight, the date changes.

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 minutes. A negative number goes the other way.

Java
LocalDateTime start = LocalDateTime.of(2026, 3, 15, 9, 0);
LocalDateTime result = start.plusMinutes(45);   // 2026-03-15T09:45
System.out.println(start);   // 2026-03-15T09:00
CallWhat it does
dt.plusMinutes(n)Returns a new date-time with n minutes added.
dt.minusMinutes(n)The same idea in the opposite direction.
dt.plus(n, ChronoUnit.MINUTES)The general form. It does the same thing for this unit.
time.plusMinutes(n)LocalTime has the same method, but it wraps around at midnight and has no date.

The result is a new object. Calling plusMinutes() without using the returned value does nothing useful.

Library declarations
Java
// java.time.LocalDateTime
public LocalDateTime plusMinutes(long minutes)

Parameters

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

Return Value

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

Compare with Similar Methods

Methods that move a date-time in time:

MethodHow it differs
minusMinutes(n)The opposite direction for minutes.
plus(n, unit)The general method: you choose the unit as an argument.
plusHours(n)Adds hours for a bigger step.
plusSeconds(n)Adds seconds for a finer step.

Java Examples

Example 1 — Find When a Class Ends

A class starts at 09:00 and lasts 45 minutes. Print the start and the end.

Java
import java.time.LocalDateTime;

public class LdtPlusMinutesDemo {
    public static void main(String[] args) {
        LocalDateTime classStart = LocalDateTime.of(2026, 3, 15, 9, 0);
        LocalDateTime classEnd = classStart.plusMinutes(45);

        System.out.println("starts: " + classStart);
        System.out.println("ends:   " + classEnd);
    }
}

How It Works

  1. The start. The class begins at 09:00.
  2. Add 45 minutes. plusMinutes(45) gives 09:45.
  3. Same day. Nothing passed midnight, so the date stays the 15th.

Example 2 — Add Minutes Across an Hour and Midnight

Add 90 minutes to 10:30, and 20 minutes to 23:50.

Java
import java.time.LocalDateTime;

public class LdtPlusMinutesRollover {
    public static void main(String[] args) {
        LocalDateTime morning = LocalDateTime.of(2026, 3, 15, 10, 30);
        LocalDateTime night = LocalDateTime.of(2026, 3, 15, 23, 50);

        System.out.println("10:30 + 90 min: " + morning.plusMinutes(90));
        System.out.println("23:50 + 20 min: " + night.plusMinutes(20));
    }
}

How It Works

  1. 90 minutes is 1 hour 30 minutes. 10:30 plus 90 minutes is 12:00, so the hour and minute both change.
  2. 23:50 plus 20 minutes. The clock passes midnight, so the time is 00:10.
  3. The date moves on. The second result is on 16 March, not the 15th.

Example 3 — Print a Bus Timetable

A bus leaves every 20 minutes starting at 08:00. Use a loop to print the first four departures.

Java
import java.time.LocalDateTime;

public class LdtPlusMinutesBus {
    public static void main(String[] args) {
        LocalDateTime bus = LocalDateTime.of(2026, 3, 15, 8, 0);

        for (int i = 1; i <= 4; i++) {
            System.out.println("bus " + i + ": " + bus.toLocalTime());
            bus = bus.plusMinutes(20);
        }
    }
}

How It Works

  1. The first bus. It leaves at 08:00.
  2. Print, then move on. Each round prints the time, then plusMinutes(20) prepares the next departure.
  3. Only the time is shown. toLocalTime() drops the date, so the lines read 08:00, 08:20, 08:40, and 09:00.
  4. The hour changes by itself. After 08:40, the next departure is 09:00.

Frequently Asked Questions

Call dt.plusMinutes(n). It returns a new LocalDateTime, so store it: dt = dt.plusMinutes(n).
No. LocalDateTime is immutable, so plusMinutes() returns a new object and leaves the original as it was.
Yes. A negative number moves the other way, so dt.plusMinutes(-n) gives the same result as dt.minusMinutes(n).
Use LocalDateTime.now().plusMinutes(30).
Use plusMinutes(90), or call plusHours(1).plusMinutes(30). Both give the same result.

Next: plusMonths()

Return a copy that is a number of months later.

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

11 people found this page helpful