Java Date Time Java Java API
java.time.OffsetDateTime
public OffsetDateTime plusMinutes(long minutes)
package com.logicbig.example.offsetdatetime;import java.time.OffsetDateTime;import java.time.ZoneOffset;public class PlusMinutesExample { public static void main(String... args) { OffsetDateTime d = OffsetDateTime.of(2015, 11, 15, 18, 20, 30, 100, ZoneOffset.ofHours(-6)); OffsetDateTime d2 = d.plusMinutes(1000); System.out.println(d2); OffsetDateTime d3 = d.plusMinutes(-1000); System.out.println(d3); }}
2015-11-16T11:00:30.000000100-06:002015-11-15T01:40:30.000000100-06:00