java.time.Duration.minus(long amountToSubtract, TemporalUnit unit)
java.time.Duration.minus(long amountToSubtract, TemporalUnit unit)
package com.codingdict;
import java.time.Duration;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
public class DurationDemo {
public static void main(String[] args) {
Duration duration = Duration.between(LocalTime.NOON,LocalTime.MAX);
System.out.println(duration.getSeconds());
Duration duration1 = duration.minus(100,ChronoUnit.SECONDS);
System.out.println(duration1.getSeconds());
}
}