Returns a copy of this LocalDateTime with the specified number of seconds subtracted, adjusting other fields if necessary.
package com.logicbig.example.localdatetime;
import java.time.LocalDateTime;
public class MinusSecondsExample {
public static void main (String... args) {
LocalDateTime d = LocalDateTime.of(2016, 11, 12,
12, 30, 15);
LocalDateTime d2 = d.minusSeconds(10000);
System.out.println(d2);
d2 = d.minusSeconds(-10000);
System.out.println(d2);
}
}
Output
2016-11-12T09:43:35
2016-11-12T15:16:55