Returns a copy of this LocalDateTime with the specified number of weeks subtracted, adjusting other fields if necessary.
package com.logicbig.example.localdatetime;
import java.time.LocalDateTime;
public class MinusWeeksExample {
public static void main (String... args) {
LocalDateTime d = LocalDateTime.of(2016, 11, 12,
12, 30, 15);
LocalDateTime d2 = d.minusWeeks(200);
System.out.println(d2);
d2 = d.minusWeeks(-200);
System.out.println(d2);
}
}
Output
2013-01-12T12:30:15
2020-09-12T12:30:15