minus() Methods
Description
minusXXX()
returns a copy of an object by subtracting a specified value.
Example
The following code shows how to subtract time from local date object.
import java.time.LocalDate;
//w w w .j av a 2 s. co m
public class Main {
public static void main(String[] args) {
LocalDate localDate = LocalDate.of(2014, 6, 21);
LocalDate localDate1 = localDate.minusMonths(5);
System.out.println(localDate1);
LocalDate localDate2 = localDate.minusWeeks(3);
System.out.println(localDate2);
}
}
The code above generates the following result.