Returns a copy of this LocalDateTime with the specified number of weeks added.
package com.logicbig.example.localdatetime;
import java.time.LocalDateTime;
import java.time.Month;
public class PlusWeeksExample {
public static void main (String... args) {
LocalDateTime d = LocalDateTime.of(2016, Month.APRIL, 1,
22, 20, 30, 500000);
LocalDateTime d2 = d.plusWeeks(30);
System.out.println(d2);
d2 = d.plusWeeks(-30);
System.out.println(d2);
}
}
Output
2016-10-28T22:20:30.000500
2015-09-04T22:20:30.000500