Java LocalDateTime minusMinutes() Method

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

Definition

In Java, minusMinutes(minutes) returns a new LocalDateTime that is the given number of minutes earlier 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.minusMinutes(1);. When the minutes go back past the start of an hour, the hour changes, and past 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, 10, 30);
LocalDateTime result = start.minusMinutes(15);   // 2026-03-15T10:15
System.out.println(start);   // 2026-03-15T10:30
CallWhat it does
dt.minusMinutes(n)Returns a new date-time with n minutes subtracted.
dt.plusMinutes(n)The same idea in the opposite direction.
dt.minus(n, ChronoUnit.MINUTES)The general form. It does the same thing for this unit.
time.minusMinutes(n)LocalTime has the same method, but it wraps around at midnight and has no date.

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

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

Parameters

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

Return Value

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

Compare with Similar Methods

Methods that move a date-time in time:

MethodHow it differs
plusMinutes(n)The opposite direction for minutes.
minus(n, unit)The general method: you choose the unit as an argument.
minusHours(n)Subtracts hours for a bigger step.
minusSeconds(n)Subtracts seconds for a finer step.

Java Examples

Example 1 — Set a Meeting Reminder

A meeting starts at 10:30 and you want a reminder 15 minutes before. Print both times.

Java
import java.time.LocalDateTime;

public class LdtMinusMinutesDemo {
    public static void main(String[] args) {
        LocalDateTime meeting = LocalDateTime.of(2026, 3, 15, 10, 30);
        LocalDateTime reminder = meeting.minusMinutes(15);

        System.out.println("meeting:  " + meeting);
        System.out.println("reminder: " + reminder);
    }
}

How It Works

  1. The meeting. It starts at 10:30.
  2. Fifteen minutes earlier. minusMinutes(15) gives 10:15.
  3. The meeting time is untouched. The new time is a separate object.

Example 2 — Go Back Across an Hour and Midnight

Subtract 90 minutes from noon, and 20 minutes from ten past midnight.

Java
import java.time.LocalDateTime;

public class LdtMinusMinutesRollover {
    public static void main(String[] args) {
        LocalDateTime noon = LocalDateTime.of(2026, 3, 15, 12, 0);
        LocalDateTime night = LocalDateTime.of(2026, 3, 15, 0, 10);

        System.out.println("12:00 - 90 min: " + noon.minusMinutes(90));
        System.out.println("00:10 - 20 min: " + night.minusMinutes(20));
    }
}

How It Works

  1. 90 minutes is 1 hour 30 minutes. Noon minus 90 minutes is 10:30.
  2. 00:10 minus 20 minutes. The clock goes back past midnight and shows 23:50.
  3. The date goes back too. The second result is on 14 March, not the 15th.

Example 3 — Send Reminders at Several Times

A class starts at 14:00. Loop over 60, 30, and 10 minutes and print each reminder time.

Java
import java.time.LocalDateTime;

public class LdtMinusMinutesLadder {
    public static void main(String[] args) {
        LocalDateTime start = LocalDateTime.of(2026, 3, 15, 14, 0);
        int[] before = {60, 30, 10};

        for (int minutes : before) {
            System.out.println(minutes + " minutes before: " + start.minusMinutes(minutes).toLocalTime());
        }
    }
}

How It Works

  1. Three reminder gaps. The array holds 60, 30, and 10.
  2. Each round starts from the class time. start is never changed, so every reminder is measured from 14:00.
  3. Only the time is printed. toLocalTime() drops the date, giving 13:00, 13:30, and 13:50.

Frequently Asked Questions

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

Next: minusMonths()

Return a copy that is a number of months earlier.

minusMonths() 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