OffsetTime minus(TemporalAmount amountToSubtract) example
Description
OffsetTime minus(TemporalAmount amountToSubtract)
returns a copy of this time with the specified amount subtracted.
Syntax
minus
has the following syntax.
public OffsetTime minus(TemporalAmount amountToSubtract)
Example
The following example shows how to use minus
.
import java.time.OffsetTime;
import java.time.Period;
/*from www.ja v a 2 s . co m*/
public class Main {
public static void main(String[] args) {
OffsetTime m = OffsetTime.now();
OffsetTime n = m.minus(Period.ofDays(12));
System.out.println(n);
}
}