OffsetTime minus(long amountToSubtract, TemporalUnit unit)
returns a copy of this time with the specified amount subtracted.
minus
has the following syntax.
public OffsetTime minus(long amountToSubtract, TemporalUnit unit)
The following example shows how to use minus
.
import java.time.OffsetTime; import java.time.temporal.ChronoUnit; /* ww w . j av a2 s .com*/ public class Main { public static void main(String[] args) { OffsetTime m = OffsetTime.now(); OffsetTime n = m.minus(14,ChronoUnit.DAYS); System.out.println(n); } }