Returns a copy of this instant with the specified duration in seconds added.
package com.logicbig.example.instant;
import java.time.Instant;
public class PlusSecondsExample {
public static void main(String... args) {
Instant i = Instant.now();
System.out.println(i);
Instant i2 = i.plusSeconds(20000);
System.out.println(i2);
Instant i3 = i.plusSeconds(-20000);
System.out.println(i3);
}
}
Output
2017-05-01T20:57:13.972Z
2017-05-02T02:30:33.972Z
2017-05-01T15:23:53.972Z