Java Date Time Java Java API
java.time.OffsetDateTime
public OffsetDateTime plusWeeks(long weeks)
package com.logicbig.example.offsetdatetime;import java.time.OffsetDateTime;import java.time.ZoneOffset;public class PlusWeeksExample { public static void main(String... args) { OffsetDateTime d = OffsetDateTime.of(2015, 11, 15, 18, 20, 30, 100, ZoneOffset.ofHours(-6)); OffsetDateTime d2 = d.plusWeeks(3500); System.out.println(d2); OffsetDateTime d3 = d.plusWeeks(-400); System.out.println(d3); }}
2082-12-13T18:20:30.000000100-06:002008-03-16T18:20:30.000000100-06:00