Home Java LocalDateTime Methods minusMinutes() Java LocalDateTime minusMinutes() Method 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.
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 Call What 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.time.LocalDateTime
public LocalDateTime minusMinutes(long minutes) Parameters Parameter Description minutes (long)The number of minutes to subtract. It can be zero or negative.
Return Value Return Value Description LocalDateTimeA new LocalDateTime with the minutes subtracted. The original is not changed.
Important
The amount can be large: minusMinutes(1440) goes back a whole day, and minusMinutes(90) goes back an hour and a half. As with the other methods, there is no daylight saving rule, because LocalDateTime has no time zone.
Compare with Similar Methods Methods that move a date-time in time:
Java Examples 1. Meeting reminder 2. Rollover back 3. Reminder ladder Example 1 — Set a Meeting Reminder A meeting starts at 10:30 and you want a reminder 15 minutes before. Print both times.
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);
}
} meeting: 2026-03-15T10:30
reminder: 2026-03-15T10:15 How It Works The meeting. It starts at 10:30.Fifteen minutes earlier. minusMinutes(15) gives 10:15.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.
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));
}
} 12:00 - 90 min: 2026-03-15T10:30
00:10 - 20 min: 2026-03-14T23:50 How It Works 90 minutes is 1 hour 30 minutes. Noon minus 90 minutes is 10:30.00:10 minus 20 minutes. The clock goes back past midnight and shows 23:50.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.
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());
}
}
} 60 minutes before: 13:00
30 minutes before: 13:30
10 minutes before: 13:50 How It Works Three reminder gaps. The array holds 60, 30, and 10.Each round starts from the class time. start is never changed, so every reminder is measured from 14:00.Only the time is printed. toLocalTime() drops the date, giving 13:00, 13:30, and 13:50.Frequently Asked Questions How do I subtract minutes from a LocalDateTime in Java? Call dt.minusMinutes(n). It returns a new LocalDateTime, so store it: dt = dt.minusMinutes(n).
Does minusMinutes() change the original LocalDateTime? No. LocalDateTime is immutable, so minusMinutes() returns a new object and leaves the original as it was.
Can I pass a negative number to minusMinutes()? Yes. A negative number moves the other way, so dt.minusMinutes(-n) gives the same result as dt.plusMinutes(n).
How do I subtract 30 minutes from the time in Java? Call dt.minusMinutes(30), or LocalDateTime.now().minusMinutes(30) for half an hour ago.
How do I subtract 1 hour and 30 minutes in one call? Use minusMinutes(90), or call minusHours(1).minusMinutes(30). Both give the same result.
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